Code Monkey home page Code Monkey logo

perlbot's Introduction

PerlBot

This is a Tumblr bot written in Perl! So far it's not complete but I'm working on it

It's based on Pearl from Steven Universe.

The blog is at http://perlbot.tumblr.com/

Branches

master

This branch is stable and has the code I use for posting posts most of the time

Files

perlbot.pl

All the functions for perlbot.

There is no official Tumblr API for Perl, but there is WWW::Tumblr, which I use.

(the official Tumblr API documentation is also very useful!)

main.pl

This script calls the functions written in perlbot.pl to queue posts and answer asks.

For obvious reasons, I removed the OAuth parameters from the code (they're stored in environment variables).

show_dialogue.txt

This is all the dialogue that Pearl ever says for the Markov Chain to generate sentences from.

So far it has the dialogue from all the episodes from Gem Glow to Lars' Head.

I get it from the Steven Universe wikia and each sentence is on its own line.

blog_dialogue.txt

All the messages Perlbot got from the blog

answered_asks_ids

The ids of asks that were already answered (since I don't know how to remove them from the inbox) (soon to be unused)

hourly_update_script.sh

The script that is run hourly.

It:

  1. Fetches the remote repository & merges
  2. Runs main.pl
  3. Makes a commit of blog_dialogue.txt
  4. Pushes it to Github

Dependencies

Perl

  • utf8
  • Net::OAuth
  • HTTP::Request::Common
  • LWP::UserAgent
  • WWW::Tumblr
  • Inline::Python
  • Data::Dumper
  • HTML::Entities
  • String::Markov
  • Lingua::EN::Tagger
  • XML::LibXML
  • File::Random

perlbot's People

Contributors

givralix avatar

Stargazers

 avatar  avatar

Watchers

 avatar

perlbot's Issues

use regex to get asks or whatever

the only way i can retrieve asks & submissions is by dumping the thing using Data::Dumper
now i gotta parse this shit
example of stuff to parse: http://pastebin.com/9QHXefdj
for asks, i gotta get the reblog_key, the asking_name (so i can know who sent what), the question, the date (again for displaying) and the id
i dont really care abt submissions now
i can know whether it's an ask or submissions using the type (it's "answer" for asks and "text", "link" or "photo" for submissions)

port the shitpost generating function to perl

i want her to be as much perl as possible
and since i got better at coding perl (went from "i read a tutorial up till the part about variables" to "i know how to call a function") i think i can do it

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.