Giter Site home page Giter Site logo

ティン・ルーフ

this is the code that powers @tinruufu, which happens to include a small but useful danbooru api client as well as a utility for downloading all images from a danbooru search result

requirements

you need python 2.7, probably running on a unix-y system like linux or bsd or mac osx or something

there are also some python things you can install with pip install [package] to make stuff work

completely necessary:

  • requests, which we use to hit the danbooru api and download files

optional:

  • gevent, for if you want to download files in parallel (it'll work fine without it, but it'll be slower)
  • tweepy, for tweeting

configuration

you can set twitter and danbooru credentials if you like; make a file called secrets.py in this directory and make it look something like this:

danbooru_login = 'username'
danbooru_key = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'

token_key = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
token_secret = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
app_key = 'AAAAAAAAAAAAAAAAAAAAAAAAA'
app_secret = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'

without danbooru credentials associated with a gold account, you won't be able to access images with censored tags

without twitter keys and a file you can read at /usr/share/dict/words, you won't be able to tweet

components (in order of how likely i think you are to be interested in them)

dl.py (the bit that downloads files)

to download all images containing nekomimi and red hair, for example, you would run python dl.py nekomimi red_hair

files are downloaded to a downloads directory in the current working directory

nt.py (the library and thing that tweets)

nt.py is where the business happens; it includes the utilities that the rest of the stuff uses and will try to tweet when invoked as a script

all arguments are taken as tags to filter by, just like dl.py

tweet_soon.py (the thing that makes the timing interesting)

a delayed wrapper for nt.py that takes the same arguments and does the same thing, but waits a random interval between 0 and 48 hours before doing anything.

ティン・ルーフ's Projects

ablankblank icon ablankblank

a queer robot trying to fill out the form on okcupid's front page

bildkomposita icon bildkomposita

Twitterbot that generates random compound words that look like BILD headlines.

dont-bully icon dont-bully

a simple script for telling people not to bully

friction icon friction

a browser-based gallery viewer tailored for viewing large collections of pornographic manga

genderkit icon genderkit

Gender Construction Kit - The UK guide to changing things linked to gender

qtile icon qtile

:cookie: A full-featured, hackable tiling window manager written and configured in Python

seedbank icon seedbank

Drop-in replacement for Python's random module that records and can replay seeds [Public domain]

typenullbot icon typenullbot

a robot that tweets error messages fished out of stackoverflow posts with no context

urbandictionery icon urbandictionery

totally unnecessary feature-complete reimplementation of @urbandictionary's twitter account

wordfilter icon wordfilter

A small module meant for use in text generators that lets you filter strings for bad words.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.