bigodines
By: a guest | Oct 29th, 2009 | Syntax:
Python | Size: 1.04 KB | Hits: 484 | Expires: Never
# -*- coding: utf-8 -*-
import twitter
import time
import os
from datetime import datetime
class BigoBot(object):
"""
BigoBot is a Twitter bot for server manipulation. It was designed to download pr0n into our home server. Use at your own risk.
"""
def __init__(self,username,password):
self.username = username
self.api = twitter.Api(username=username, password=password)
self.tweets = []
self.latest = None
def checkTweets(self):
self.readTweets(self.username)
def readDirectMessages(self):
return self.api.GetDirectMessages()
def check(self):
self.tweets = self.readDirectMessages()
for tweet in self.tweets:
self.download(tweet)
self.api.DestroyDirectMessage(tweet.GetId())
def download(self,tweet):
url,name = tweet.GetText().split(" ")
print "downloading:",url,name
os.system("wget %s; mv *.torrent /discao/HD\ 1TB/torrents/%s" % (url, name))
if __name__ == "__main__":
bb = BigoBot("bigobot","<senha super secreta>")
while True:
bb.check()
time.sleep(3600)