def auto_follow(self): self.label2 = Label(self.fourthFrame, text="Loading") self.label2.grid(row=6, columnspan=2, pady=10) self.canvas = Canvas(self.fourthFrame, width=465, height=22, bg="white") self.canvas.grid(row=7, columnspan=2) fill_line = self.canvas.create_rectangle(1.5, 1.5, 0, 23, width=0, fill="green") tkinter.messagebox.showinfo( title="Information", message= "Processing, it takes around 10s - 60s to follow one account. Please wait unitl it finishes!" ) keyword = self.entry1.get() num = self.entry2.get() my_bot = TwitterBot("config2.txt") my_bot.sync_follows() my_bot.auto_follow(keyword, self.canvas, self.master, fill_line, count=num) tkinter.messagebox.showinfo(title="Information", message="Done!")
def retweet(): # create an instance of the TwitterFollowBot # by default, the bot will look for a configuration file called config.txt in your current my_bot = TwitterBot() # autoretweets the 5(count) latest tweets that matches the hashtag my_bot.auto_rt("#AppleEvent", count=5) return {'message': 'retweeted successfully'}
def main(): #workingdir = os.getcwd() #Raybotdir = os.listdir(workingdir+"/AllBotConfig/") Raybotdir = os.listdir( "https://guarded-chamber-8525.herokuapp.com/AllBotConfig/") for ig in Raybotdir: my_bot = TwitterBot("/AllBotConfig/" + ig) my_bot.auto_fav( "#Rayviewz", count=30 ) #Automatically favourite any tweet with a specitfic phrase. my_bot.auto_rt( "#Rayviewz", count=10 ) # Automatically retweet any tweet with a specitfic phrase.
from TwitterFollowBot import TwitterBot my_bot = TwitterBot() my_bot.auto_follow("business")
import sys import os import argparse from TwitterFollowBot import TwitterBot my_bot = TwitterBot("config-sendx.txt") ap = argparse.ArgumentParser(description='Twitter growth strategies') dir_path = os.path.dirname(os.path.realpath(__file__)) def follow_follower_of_account(account, _count): print "About to start following followers of " + account my_bot.auto_follow_followers_of_user(account, count=_count) def follow_user_like_tweet(file_name, count): file_path = dir_path + "/data/" + file_name print "Reading phrases from file " + file_path with open(file_path) as f: for num in range(0, int(count)): for phrase in f: print "Following the user and liking the tweet with phrase " + phrase my_bot.auto_fav_and_follow(phrase, count) def follow_user_retweet(file_name, count): file_path = dir_path + "/data/" + file_name
"r") as already_txt: for non_follower in already_txt: alr_follow.append(int(non_follower)) i = 0 while i < len(alr_follow): if (alr_follow[i] in followers_a): del alr_follow[i] i += 1 with open('/home/scripts/twitter/already-followed.txt', "w") as out_file: for non_follower in alr_follow: out_file.write("%s\n" % (non_follower)) config = 'config.txt' my_bot = TwitterBot(config) stars = '*' * 10 if not os.path.isfile('followers.txt'): print('%sPhase of follow followers%s' % (stars, stars)) print(time.asctime(), '\n') my_bot.sync_follows() my_bot.auto_follow_followers() print('%sWaiting 6-7h%s' % (stars, stars)) print(time.asctime(), '\n') time.sleep(random.randint(6 * 60 * 60, 7 * 60 * 60)) while True: following_bot = my_bot.get_follows_list()
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # #Author: Ray Okaah #This prunes / auto un follows every user who is not following back. from TwitterFollowBot import TwitterBot #Below, Raybotlist is Depreciated #Raybotlist = "m1.txt,m2.txt,m3.txt,m4.txt,m5.txt,m6.txt,m7.txt,m8.txt,,m9.txt,m10.txt,m11.txt,m12.txt,m13.txt,m14.txt,m15.txt,m16.txt,m17.txt,m18.txt,m19.txt,m20.txt,m21.txt,m22.txt,m23.txt,m24.txt,m25.txt,m26.txt,m27.txt,m28.txt,m29.txt,m30.txt,m31.txt,m32.txt,m33.txt,m34.txt,m35.txt,m36.txt,m37.txt,m38.txt,m39.txt,m40.txt,m41.txt,m42.txt,m43.txt,m44.txt,m45.txt,m46.txt,m47.txt,m48.txt,m49.txt,m50.txt" #workingdir = os.getcwd() #Raybotdir = os.listdir(workingdir+"/AllBotConfig/") Raybotdir = os.listdir("https://guarded-chamber-8525.herokuapp.com/AllBotConfig/") for ig in Raybotdir: my_bot = TwitterBot("/AllBotConfig/"+ig) my_bot.auto_unfollow_nonfollowers() if __name__ == '__main__': bot = PruneRun.py() bot.run()
from TwitterFollowBot import TwitterBot my_bot = TwitterBot("mcon.txt") my_bot.auto_follow_followers_of_user("TheHiddenWorId", count=25)
####Post from TwitterFollowBot import TwitterBot my_bot = TwitterBot() my_bot.send_tweet("Teste") #### from TwitterFollowBot import TwitterBot my_bot = TwitterBot() from TwitterFollowBot import TwitterBot my_bot = TwitterBot("config.txt") ##from TwitterFollowBot import TwitterBot ## ##my_bot = TwitterBot() ##my_bot.auto_follow("") ## ##from TwitterFollowBot import TwitterBot ## ##my_bot = TwitterBot() ##my_bot.auto_follow("") ## ##from TwitterFollowBot import TwitterBot ## ##my_bot = TwitterBot() ##my_bot.auto_follow("", count=100)
from TwitterFollowBot import TwitterBot from bs4 import BeautifulSoup import time, random while True: my_bot = TwitterBot()#Инициализирую бота def getQoute(): soup = BeautifulSoup(open('test1.html'), 'lxml') for rendom_aph in soup.find_all('div',{'class':'rendom_aph'}): print((str(rendom_aph.text))) if len(rendom_aph.text) >=132: #Проверка длины отправки сообщения Если больше 133 то повторно выполнить парсинг time.sleep(10) getQoute() else: return rendom_aph.text a = getQoute() #dict = ['Qoute', 'DatQt', 'FunDy', 'Mind'] #Словарь хештегов my_bot.send_tweet(a + '#Follow' )#Бот шлет сообщение time.sleep(3600)
def retweet(): my_bot = TwitterBot() my_bot.auto_rt("caa", count=10)
def retweet(event): my_bot = TwitterBot() hashtag = '#' + event['hashtag'] # autoretweets the 5(count) latest tweets that matches the hashtag my_bot.auto_rt(hashtag, count=5)
logger.info("Fetching Complete w/ no errors!") def syncCronListener(event): if event.exception: logger.error("syncCronListener: %s" % repr(event.exception)) else: logger.info("Syncing Complete w/ no errors!") if __name__ == "__main__": #start logger.info("[+]Starting MoombahBot") #init scheduler sched = BackgroundScheduler() #init bot moombahBot = TwitterBot(config_file=apiConfFile, logger=logger) #Sync once daily sched.add_job(lambda: moombahBot.sync_follows(), 'interval', hours=23, replace_existing=True) sched.add_listener(fetchCronListener, events.EVENT_JOB_EXECUTED | events.EVENT_JOB_ERROR) logger.debug('Account sync cronjob added') #Fetch at interval sched.add_job(lambda: fetch(moombahBot), 'interval', minutes=fetchIntervalMinutes, replace_existing=True) sched.add_listener(syncCronListener, events.EVENT_JOB_EXECUTED | events.EVENT_JOB_ERROR) logger.debug('Fetch cronjob added') #start sched cron sched.start() #Running
def bot1(keyword, count): my_bot = TwitterBot("config.txt") my_bot.sync_follows() my_bot.auto_follow(keyword, count=count)
def __init__(self): self.bot = TwitterBot() self.bot.sync_follows()