IP ranges come from Creeper.se and mediacreeper.com
You can follow them on @5thEstateWiki and @WikiCreeperEdit
This little coffee script will watch Wikipedia for edits from a set of named IP ranges and will tweet when it notices one. It was inspired by @parliamentedits and is used to make @congressedits available. It is now being used a community of users to post selected Wikipedia edits to Twitter.
To run anon you will need to:
- install Node
npm install -g coffee-script
git clone https://github.com/edsu/anon.git
cd anon
npm install
cp config.json.template config.json
- add twitter credentials for your bot to
config.json
(make sure the Twitter app you create has read/write permission so it can tweet) - add IP ranges/names to
config.json
- modify status template if desired
./anon.coffee
(you may want to run this in a screen or tmux session, or on a cloud service like Heroku (see below))
You will notice in the example config.json.template
that you can configure
ip address ranges using a netmask:
"143.231.0.0/16"
or with an array of start/end IP addresses:
["143.231.0.0", "143.231.255.255"]
These two are equivalent, but the former is a bit faster, and easier to read. The latter is convenient if your range is difficult to express using a netmask.
If you would like your configuration file to reference the IP addresses in the external file just use the filename. So instead of:
{
"nick": "anon1234",
"accounts": [
{
"consumer_key": "",
"consumer_secret": "",
"access_token": "",
"access_token_secret": "",
"template": "{{page}} Wikipedia article edited anonymously from {{name}} {{&url}}",
"ranges": {
"Home Network": [
["192.168.1.1", "192.168.255.255"]
]
}
}
]
}
you would have:
{
"nick": "anon1234",
"accounts": [
{
"consumer_key": "",
"consumer_secret": "",
"access_token": "",
"access_token_secret": "",
"template": "{{page}} Wikipedia article edited anonymously from {{name}} {{&url}}",
"ranges": "ranges.json"
}
]
}
If you would like to test without tweeting you can run anon with the
--noop
flag, which will cause the tweet to be written to the console
but not actually sent to Twitter.
./anon.coffee --noop
If you would like to see all the change activity (URLs for each change) to test
that it is actually listening, use the --verbose
flag:
./anon.coffee --verbose
By default anon will look for a config.json
file in your current working
directory. If you would like to specify the location of the configuration
file, use the --config
parameter:
./anon.coffee --config test.config
A Procfile is included to facilitate running anon on the Heroku cloud service. Once you've satisfied the Heroku prerequisites and setup Heroku, you can run anon via:
heroku create
git push heroku master
heroku ps:scale worker=1
Read more on running Node.js applications on Heroku.
There is not much to anon but there is a small test suite, which might come in handy if you want to add functionality.
npm test
anon uses the wikichanges module to listen to 38 language Wikipedias. wikichanges achieves this by logging in to the Wikimedia IRC server and listening to the recent changes channels for each Wikipedia. So if you plan on running wikichanges be sure your network supports IRC (it can sometimes be blocked).
Here are the Wikipedias that it currently supports:
- Arabic
- Bulgarian
- Catalan
- Chinese
- Czech
- Danish
- Dutch
- English
- Esperanto
- Euskara
- Farsi
- Finnish
- French
- German
- Greek
- Hebrew
- Hungarian
- Indonesian
- Italian
- Japanese
- Korean
- Lithuanian
- Malaysian
- Norwegian
- Polish
- Portuguese
- Romanian
- Russian
- Slovak
- Slovene
- Spanish
- Swedish
- Turkish
- Ukrainian
- Vietnamese
- Volapük
- Wikidata
- Wikimedia Commons
If you would like to have another one added please add a ticket to the wikichanges issue tracker.
Below is a list of known anon instances. Please feel free to add, in an alphabetic order, your own by sending a pull request.
- @2dekameredits
- @5thEstateWiki
- @academyedits
- @AUSgovEdits
- @AussieParlEdits
- @bcgovedits
- @bclegedits
- @beehive_edits
- @berlinEDUedits
- @BotDetectorCamb
- @BrockWikiEdits
- @brwikiedits
- @bundesedit
- @ciaedits
- @cmuedits
- @congresseditors
- @congressedits
- @DailEireannEdit
- @EduskuntaEdit
- @EstadoEdita
- @euroedit
- @FloridaEdits
- @FTingetWikiEdit
- @gccaedits
- @goldmanedits
- @gruedits
- @harvardedits
- @hgbedit
- @IEGoveEdits
- @IrishGovEdits
- @israeledits
- @ItaGovEdits
- @kameredits
- @LAGovEdits
- @LATechEdits
- @lc_edits
- @LRSwikiedits
- @michigan_edits
- @MITedits
- @monsantoedits
- @NATOedits
- @NCGAedits
- @nsaedits
- @nsgovedits
- @oiledits
- @ONgovEdits
- @OverheidEdits
- @PakistanEdits
- @Parlamento_Wiki
- @parliamentedits
- @parlizaedits
- @pentagon-edits
- @phrmaedits
- @politikedits
- @rcmp_edits
- @Regierungsedits
- @reichstagedits
- @RialtasWatch
- @RiksdagWikiEdit
- @RuGovEdits_en
- @RuGovEdits
- @stanfordedits
- @swissgovedit
- @UaGovEdits_en
- @UaGovEdits
- @UaGoveEdits_ru
- @un_edits
- @valleyedits
- @WhitehallEdits
- @WikiCreeperEdit
- @wikiAssemblee
- @wikistorting
- @zagovedits
- CC0 public domain dedication