Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Random Charity Bot

Twitter bot that tweets the name and website of a random charity. The data is based on the register held by the Charity Commission for England and Wales, released as open data.

The bot randomly selects an active charity from the register, and tweets it. If the website of the charity is known it tweets that too, otherwise it gives a link to the official register entry for that charity.

This bot isn't affiliated with the Charity Commission, and gives no endorsement of the charities tweeted.

Load data

Fetches data from the Charity Commission open data page, and turns it into a JSON file with the needed details in. The data file is then used by to construct a tweet about a charity.


If the url of the Charity Commission data changes you can add the --data-url property to point to the new address.

The data is updated monthly so running this command every month will ensure new charities are tweeted and removed ones aren't.

Add twitter authentication details

You need to set up a twitter app, and get four keys to authorize your app:

  • Consumer key
  • Consumer secret
  • Access token
  • Access token secret

Instructions are available here

These should be added to a config file, in the same style as example.cfg. Call this file something like config.cfg.

Set tweets going

Use the following command:

python -c config.cfg

Where config.cfg is the path to your configuration file. You can also add individual configuration options directly to the command, like:

python -c config.cfg --sleep 3600

(This would set the time between tweets to one hour)

Possible future development

  • include Scottish & Northern Irish charities
  • regional/sector version
  • boost larger charities in random search to show more household names
  • lookup twitter account and use that handle (eg <> has data)



Twitter bot that tweets the name and website of a random charity



No releases published


No packages published