/faexport

The API for Furaffinity you wish existed

Primary LanguageRubyBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

FAExport

Simple data export and feeds from FA. Check out the documentation for a full list of functionality. The file lib/faexport/scraper.rb contains all the code required to access data from FA.

Development Setup

Create a file named settings.yml in the root directory containing a valid FA cookie:

cookie: "b=3a485360-d203-4a38-97e8-4ff7cdfa244c; a=b1b985c4-d73e-492a-a830-ad238a3693ef"

This cookie can be generated by visiting any FA page and running the folowing code in the developer console:

document.cookie.split('; ').filter(function(x){return/^[ab]=/.test(x)}).sort().reverse().join('; ')

You may want to do this in a private browsing session as logging out of your account will invalidate the cookie and break the scraper.

Install Redis, Ruby and Bundler, run bundle install then bundle exec rackup config.ru to get a development server running. For example, on a Debian based system you would run:

sudo apt-get install redis-server ruby ruby-dev
sudo gem install bundler
bundle install
bundle exec rackup config.ru

Deploying

This application can be run on Heroku, just add an instance of 'Redis To Go' for caching. Rather than uploading settings.yml, set the environment variable FA_COOKIE to the generated cookie you gathered from FA.