• Stars
    star
    143
  • Rank 257,007 (Top 6 %)
  • Language
    Python
  • Created over 11 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

twitter anagram hunter

Anagramatron

Anagramatron hunts for anagrams on Twitter.

http://anagramatron.tumblr.com

http://twitter.com/anagramatron

What

Anagramatron hunts for pairs of tweets that use the exact same set of letters.

This script connects to the twitter stream. When it receives a new tweet it runs it through some filters, ignoring tweets that contain things like links or @mentions, or that contain less then a minimum number of characters.

For each tweet that passes these filters, the occurrences of each letter are counted; this serves as a simple anagram-unique hash, i.e. any pair of anagrams sorted this way will produce identical strings.

This hash is checked against a list of all the hashes we have stored so far. If nothing is found, the hash and the original text are saved in a database. If a match is found, the original text of both tweets are run through some comparison tests to check for like-ness. If they pass that text they are flagged for review, to make sure they aren't too similar, or haven't been posted previously, etcetera.

How

anagramatron.py contains the main run loop, which uses classes in twitterhandler to connect to the twitter streaming and REST api, and classes in anagramfinder to archive and retrieve possible anagrams for likeness comparison. Data storage is handled by multidbm.py, a wrapper for a flexible number of dbm databases, which lets older tweets be automatically removed when the database gets too full.

there is also a small bottle-powered webserver that allows remote review of possible anagrams. There is a companion iPhone app that I use to check up on progress.

when hits are approved (manually) they are automatically posted to associated twitter and tumblr accounts.

  • The vast majority of 'hits' are tweets that are identical.
  • The vast majority of remaining hits are either tweets that have one letter switched ('I hate u' vs. 'I haet u') or that have the same words in a different order ('hi twitter!!' vs. 'twitter, hi?'). etc.

FAQ

Other questions and comments can be directed to @cmyr or [email protected]

Q: Is this manually curated?

A: Mostly for issues of volume ( there are a lot of variations of 'goooood mooornnniinng!', there are a lot of spam bots posting subtely different versions of the same message, etc) the bot doesn't automatically post every anagram it finds. Essentially there's an iphone client that reviews matches, which are manually approved or rejected.

Q: How does this handle numerals / non-latin characters?

A: Most tweets that contain non-latin characters are ignored. Punctuation and emoji are not counted when considering anagramdom.

Q: What is the relationship between the twitter page and the tumblr?

A: One-to-one. When a match is approved, it gets posted to both.

Dependencies:

this script makes use of python twitter tools for handling twitter interactions, tumblpy for posting to tumblr, and bottle + cherrypy to run a webserver.

More Repositories

1

cargo-instruments

A cargo plugin to generate Xcode Instruments trace files
Rust
502
star
2

RustPlayground

Quickly test Rust code on macOS
Rust
238
star
3

keypath

Swift-style keypaths in Rust
Rust
58
star
4

rust-dash-docset-gen

Quickly generate Dash docsets for third-party Rust crates
Python
26
star
5

fea-rs

Parsing and compiling adobe feature files
Rust
13
star
6

poetryutils2

better poetry utils
Python
9
star
7

INTERESTING_JPG

simple bot that posts CV descriptions of images to twitter
Python
7
star
8

lsp-client

playing with the language server protocol in Rust.
Rust
5
star
9

anagram-review-ios

small iOS app for reviewing twitter anagrams
Objective-C
5
star
10

rust-python-drawing

Drawing to a rust graphics context from a python script
Rust
3
star
11

twitter-zmq-stream

utility for connecting to the twitter stream and publishing it locally to consumers via ØMQ
Python
3
star
12

bloat-cmp

😡
JavaScript
3
star
13

druid-template

hello dolly
Rust
2
star
14

xi-rustfmt

A rustfmt plugin for xi-editor
Rust
2
star
15

haikubot

a little bot that assembles haiku from tweets
Python
2
star
16

gnudbm

Ergonomic Rust bindings for gdbm
Rust
2
star
17

advent-2017

Jupyter Notebook
2
star
18

xi-future

experiments towards a future's based runloop for xi
Rust
2
star
19

pars

Deriving FromStr
Rust
2
star
20

twitter-text-tools

python tools for working with twitter data
Python
2
star
21

cargo-clean-all

A small utility script to recursively clean cargo projects
Python
2
star
22

ttx-rs

ttx, rs
Rust
1
star
23

ios-keyboard-type-selector

An iOS project for debugging Keyboard Types
Swift
1
star
24

rust-from-python-example

demo rust->python bindings
Rust
1
star
25

poetryutils

python tools for working with metre and rhyme
Python
1
star
26

aoc2018

Advent of Code 2018
Rust
1
star
27

poetastr

programatic poetry generation
Python
1
star
28

norad

Rust
1
star
29

bitflipper

Flipping bits in strings?
Rust
1
star
30

rust-buffer-bench

Benchmarking Rust text buffer implementations
Rust
1
star