Skip to content
🐦 Twitter bot for @a11yisimportant + #a11y
Branch: master
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.
tests
.env.sample
.gitignore
.travis.yml
LICENSE
README.md
index.ts
interfaces.ts
package.json
server.ts
tsconfig.json
update.sh
yarn.lock

README.md

🐦 @a11yisimportant

Travis CI Coverage Status GitHub Vulnerabilities Uptime Robot ratio (7 days) Oswald Labs Platform NPM Types NPM Twitter Follow

@a11yisimportant is a Twitter bot which follows smart people tweeting about #a11y and retweets mentions. Written in Typescript and hosted on Oswald Labs Platform.

⭐ How it works

/follow

The follow endpoint follows users tweeting with the hashtag #a11y. It runs every hour, powered by IFTTT and a webhook:

  1. Find (mixed) tweets with hashtag #a11y
  2. Like all those tweets
  3. Make a list of users (unique)
  4. Remove any users @a11yisimportant already follows
  5. Follow everyone from this list

/retweet

The retweet endpoint retweets tweets that @a11yisimportant is tagged in. It runs every hour, powered by IFTTT and a webhook:

  1. Find (recent) tweets with mention @a11yisimportant
  2. Remove any tweets written by self
  3. Remove any tweets which are already retweeted
  4. Like every tweet in this list
  5. If this tweet is a reply, get the original tweet instead
  6. Remove any duplicates (unique array)
  7. Remove any "Thanks for the follow!" tweets
  8. Retweet every tweet in this list

Interfaces

This package also exposes the following Typescript interfaces:

  • SearchResult for the result from a standard search using the Twitter API
  • SearchMeta for the metadata in a search result
  • User for a user's profile
  • Tweet for a tweet object

You can use them like this:

import { Tweet } from "a11yisimportant/interfaces" 
const tweet: Tweet = {
  id_str: "1106516296085188609",
  text: "Accessibility is important",
  user: {
    id_str: "1106514269758214144",
    screen_name: "a11yisimportant"
  }
  // . . .
};

In each interface, longint strings are preferred since JavaScript natively doesn't support such large integers (e.g., id_str instead of id).

🛠️ Development

Install dependencies:

yarn

Compile Typescript to CommonJS before running the server:

yarn build

Run local server:

yarn start

Todo

  • Auto follow
  • Auto retweet
  • Retweet CC original tweets
  • Like all mentions
  • Like all #a11y tweets

📝 License

MIT

You can’t perform that action at this time.