Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

I'm building a shit posting bot

squanchy

Poster
Joined
Mar 15, 2021
Messages
115
I need some twitter accounts you guys like for it to pull data from. I'm gonna use these accounts to help give it it's "Personality." I'd like to build a few of these bots so if you guys can give me some "gamer" twitter accounts, political, science, and really any topic specific accounts you guys like or follow. I'm gonna scrape their tweets and then use that along as some other sources that I'm going to pull from. The more accounts the better.
 

squanchy

Poster
Joined
Mar 15, 2021
Messages
115
How exactly does one “build” a bot? And how exactly do they work?
I'm going to use space magic for mine.

Edit: It's another name for a program designed to accomplish some simple task. So I'm going to write a program that will make posts that are auto generated. I'm in the very early stages of writing the code and the first thing I need to do is collect a lot of data. So an example of what the code looks like is this

Python:
def tweet_scraper(username,filename):
    tweets = api.user_timeline(screen_name=username, count=40, exclude_replis=True, include_rts=False)
    TweetContainer = open("{}.xml".format(filename), 'wb')
    tweetlist=[]

    for tweet in tweets:
        print(tweet.text)
        tweetlist.append(tweet.text)

    for tweet in tweetlist:
        TweetContainer.write(tweet.encode('utf-8'))
        TweetContainer.write('\n'.encode('utf-8'))
    TweetContainer.close()

This is a function that I wrote to pull the tweets from users right now I have the count set low because I was debugging and testing to make sure it does what I want. There're a few important pieces that I left out but this is just to give you a general idea of how you "build" the bot.
 
Last edited:

Chris Farley

Misunderstood lurker
Founder
Joined
Jan 16, 2021
Messages
2,472
I'm going to use space magic for mine.

Edit: It's another name for a program designed to accomplish some simple task. So I'm going to write a program that will make posts that are auto generated. I'm in the very early stages of writing the code and the first thing I need to do is collect a lot of data. So an example of what the code looks like is this

Python:
def tweet_scraper(username,filename):
    tweets = api.user_timeline(screen_name=username, count=40, exclude_replis=True, include_rts=False)
    TweetContainer = open("{}.xml".format(filename), 'wb')
    tweetlist=[]

    for tweet in tweets:
        print(tweet.text)
        tweetlist.append(tweet.text)

    for tweet in tweetlist:
        TweetContainer.write(tweet.encode('utf-8'))
        TweetContainer.write('\n'.encode('utf-8'))
    TweetContainer.close()

This is a function that I wrote to pull the tweets from users right now I have the count set low because I was debugging and testing to make sure it does what I want. There're a few important pieces that I left out but this is just to give you a general idea of how you "build" the bot.

tenor.gif
 

TheNJNole

Elite
Founder
Joined
Jan 10, 2021
Messages
3,280
I need some twitter accounts you guys like for it to pull data from. I'm gonna use these accounts to help give it it's "Personality." I'd like to build a few of these bots so if you guys can give me some "gamer" twitter accounts, political, science, and really any topic specific accounts you guys like or follow. I'm gonna scrape their tweets and then use that along as some other sources that I'm going to pull from. The more accounts the better.
WorldStarHipHop and BPTwitter
 
Top Bottom