jorcob's forum posts

Avatar image for jorcob
jorcob

10

Forum Posts

0

Wiki Points

4

Followers

Reviews: 0

User Lists: 2

Like others have said you need to provide a unique User-Agent in the HTTP header.

Since you're using NodeJS, I'm assuming you're using a library like require.

Fixing this is as easy as changing code from this:

require(url, callback);

To this:

var options = { url: url, headers: { 'User-Agent': 'Unique user agent goes here.' } };
require(options, callback);

This is a pretty easy fix. Just look up how to change the HTTP Header in whatever library or node-module you're using.

Avatar image for jorcob
jorcob

10

Forum Posts

0

Wiki Points

4

Followers

Reviews: 0

User Lists: 2

Hey! I made a thing.

It's a twitter bot that tweets a random game every hour.
I've been kicking around the idea of making a twitter bot for a while now and finally decided to do it. The idea isn't exactly original (I'm pretty sure others have made similar bots), but it was more of a 'see if I can do it' thing.

I've never really written anything in Python before so I'm certain the code could be much nicer/better.

The bot uses a few frameworks:

GiantBomb Python Wrapper - Git | Post, by user xupisco
Tweepy - Git | Website

You can find Game of the Hour here: https://twitter.com/gameAnHour
Sample tweet:

Anyways, here's the code! https://github.com/jacobjordan94/Game-of-the-Hour

Please feel free to tell me how awful my code is, I'd love to improve it and my Python skills.


Thanks!