A Twitter bot that renders LaTeX for you
Haskell Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ansible
app
media
src/Web/Twitter
test
.gitignore
.travis.yml
HLint.hs
LICENSE
README.markdown
Setup.hs
docker-tex2png.sh
ltxbot.cabal
ltxbot.example.conf
package.yaml
stack.yaml
tex2png.sh

README.markdown

ltxbot Build Status

A Twitter bot rendering mentions to PNGs.

Screenshot

Config

Modify ltxbot.example.conf and enter your Twiter OAuth credentials for an R/W application. You also need to provide a user token and secret for an authenticated account. An easy way to obtain these is through twurl authenticate.

Setup

You need a reasonably recent Haskell installation (GHC 7.8.3 at the time of this writing) and Docker on your system.

Docker preparation

$ # Pull my docker image with texlive-full and poppler-utils
$ docker pull passy/texlive-poppler

If you poor soul are on OS X, you need to set up a shared network drive with boot2docker. (N.B. This may no longer be necessary. Luckily, the Docker integration is far less painful these days.)

$ # Make a volume container (only need to do this once)
$ docker run -v /data --name my-data busybox true
$ # Share it using Samba (Windows file sharing)
$ docker run --rm -v /usr/local/bin/docker:/docker -v /var/run/docker.sock:/docker.sock svendowideit/samba my-data
$ # then find out the IP address of your Boot2Docker host
$ boot2docker ip
192.168.59.103

And connect to it through Finder by using cifs://192.168.59.103/data.

You may need to adjust the two *tex2png.sh scripts if any of your paths or volume names differ.

Provisioning

There's also a set of Ansible scripts available under ansible/ in this repository that can be used to set up a server.

Building

$ stack setup
$ stack build
$ stack test
$ stack exec ltxbot -- ltxbot.conf