a twitter bot greeting authors of the world on their birthday using Wikidata
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
design_docs
images
lib
scripts
tomorrow-ui
.gitignore
README.md
authors-birthday.coffee
authors-tomorrow.coffee
package.json

README.md

bot powering twitter.com/happybdauthors and facebook.com/happybdauthors

Victor_Hugo_HAPPY_BIRTHDAY

Recipe

using SPARQL

Simply customize the SPARQL query to your needs

using a dump and Couchdb

This was the bot's first implementation: more rigid and requiring more resources but I let it here as an inspiration:

curl https://dumps.wikimedia.org/wikidatawiki/entities/latest-all.json.gz |gzip -d | wikidata-filter --claim P106:Q36180 > isWriter.json
  • load all the remaining entities lines in a new CouchDB database. See the couch-wikidata-dump-importer for how I did that. It's a bit hacky but it works.

  • create the views you need using CouchDB's map functions. Here, the important view is byBirthday, and voila:

authors-per-day

a view ready to be queried by day and month by our grumpy Victor Hugo!

The result

michel-verne

adam-bartsch.png

and for the magic behind twitter and facebook displaying the right data despite Inventaire being a SPA: twitter metadata changed dynamically + prerender-ing

Authors tomorrow

npm run authors-tomorrow fetches the data of the authors of the next day and help you match them with twitter users in order to improve wikidata data before the bot comes to use it.

This will open a basic web page : tomorrow-ui

To edit wikidata using the validate button, a rightly configured instance of wikidata-agent is expected to be running on port 4115 of your machine.