ndrezn / wikipedia-pic-of-the-day Goto Github PK
View Code? Open in Web Editor NEWPosts the picture of the day from Wikipedia to Bluesky (50k followers!)
Home Page: https://bsky.app/profile/wiki-potd.bsky.social
License: MIT License
Posts the picture of the day from Wikipedia to Bluesky (50k followers!)
Home Page: https://bsky.app/profile/wiki-potd.bsky.social
License: MIT License
Since Twitter is making API access paid, keep the bot running on other social media.
Occasionally, the POTD has multiple images, like on July 25 2022: https://en.wikipedia.org/wiki/Template:POTD/2022-07-25
Occasionally, videos come up, for example from August 5 2022: https://en.wikipedia.org/wiki/Template:POTD/2022-08-05
This one is kinda gross. But! It is a pic of the day -- so -- we must post it! The file type tends to be .webm
.
Occassionally authors for photographs are annotated using templates, see: https://commons.wikimedia.org/wiki/File:Red-and-green_macaw_(Ara_chloropterus)_juvenile.JPG on https://en.wikipedia.org/wiki/Template:POTD/2022-09-07 and https://en.wikipedia.org/wiki/Template:POTD/2022-09-06. These templates should be parsed and converted to strings as part of the attribution reply. For now attribution in these cases only includes the link to the photograph.
I see an issue with posting to potd_test
. This is a shame, because potd_test
is a nice way to make sure this bot is ship-shape without posting to main, specifically a json.decoder.JSONDecoder
error. I will investigate but I am suspicious that this is caused by my Twitter API permissions not yet propagating for the new account.
Right now, captions are generated by concatanating sentences until the 240 character limit is reached. This works fine, but occassionally the first sentence is >240 characters and there's no prose attached to the tweet. In this circumstance, the caption should be tokenized by word rather than character and split in the middle of the sentence, with the rest of the sentence added to the reply caption. See https://en.wikipedia.org/wiki/Template:POTD/2022-09-26 for an example.
As noted by andrybak
over on Wikipedia:
for better compliance with licenses of the images (mostly variants of Creative Commons) I recommend that you include a link to the file page in the tweets. Either to Wikipedia https://en.wikipedia.org/wiki/File:Le_Voyage_dans_la_lune_(black_and_white,_1902).webm or Wikimedia Commons: https://commons.wikimedia.org/wiki/File:Le_Voyage_dans_la_lune_(black_and_white,_1902).webm. Quiet a few of POTD pictures are in the public domain (including today's Template:POTD/2022-09-01), but some are published under CC licenses that require attribution. For example, Template:POTD/2022-08-27, license of which was violated by https://twitter.com/wiki_potd/status/1563476127624007681. —andrybak (talk)
I think this could be resolved by adding a second reply including the name of the author and a link to the image on WP or WM.
Video support should be updated to check video length. If >2:20, crop down to 2:30 and add a fade. If <2:20, leave as-is. Twitter has a max length of 2:20 for videos.
Right now, videos <2:20 will have the last frame extended for the length it takes to fill the 2:20, which is pretty sloppy...
Since Twitter is making API access paid, keep the bot running on other social media.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.