Something went wrong. Try again later

KaleOtter

This user has not updated recently.

5 0 0 1
Forum Posts Wiki Points Following Followers

KaleOtter's forum posts

Avatar image for kaleotter
KaleOtter

5

Forum Posts

0

Wiki Points

1

Followers

Reviews: 0

User Lists: 0

#1  Edited By KaleOtter

Hey. Its my first time writing any API. I'm kind of a beginner-to-middling coder, but our college required we complete a unit on distributed systems and I'm the only one who can code in the group I was assigned.

So I'm writing something to query the GiantBomb for information about games using python, flask and urllib3. However, I keep getting 400 responses to queries I make. If i post the generated url string into postman or chrome, it works fine though. Can someone tell me what I'm doing wrong?

The Code in question

def apiConnection(self,remoteResourcePath,apiFields, filters):

http = urllib3.PoolManager()

print (remoteResourcePath)

#key to access the api

apiKey =[redacted]

#format incoming data as json, expand fields as nessecary.

#TODO: add additional logic if nessescary.

uri = 'http://www.giantbomb.com/api/'+ remoteResourcePath + '?api_key=%s&format=json' % (apiKey) \

+'&filter=%s' % (filters)\

+'&field_list=%s' %(apiFields)

print (uri)

try:

r= http.request(

'GET',

uri,

headers = {"User-Agent": 'Flask-Restful API'})

if r.status == 200: #we have valid data

returndata = {"status": True, "data": json.loads(r.data.decode('utf8'))}

else:

print (r.data)

returndata = {"status": False, "data": r.status}

except Exception as e:

returndata = {"status":False, "data":"There was a problem with urllib3 %s" % (e)}

return returndata

return returndata

The URLS It produces

http://www.giantbomb.com/api/games?api_key=[redacted]&format=json&filter=name:the matrix&field_list=name,original_release_date,original_game_rating,site_detail_url,image

Avatar image for kaleotter
KaleOtter

5

Forum Posts

0

Wiki Points

1

Followers

Reviews: 0

User Lists: 0

#2  Edited By KaleOtter

It has to be said that I love all of the movies a great deal. 4-6 were my childhood along with star trek:tng, and the prequels are hugely flawed but underrated. The new ones seem like a real mixed bag of awesome and cringe, but they're still GOOD movies.

  1. A new Hope
  2. Empire Strikes back
  3. Rogue One
  4. Return of the Jedi
  5. The Force Awakens
  6. Revenge of the sith
  7. Attack of the Clones
  8. Phantom menace
  9. The Last jedi. (I didn't dislike the movie, but felt it tonally disjointed and it missed a lot of marks that it seemed to be signposted and all the character arcs either a) sucked, or b) made no sense. It kinda had some slightly preachy subtext to it felt out of place in a movie about space monks fighting each other with glow sticks and magical powers, but I didn't think about that until someone pointed it all out to me, and it didn't change my opinion of the movie. Hyperspace scene near the end floored me. amazing peice of CGI work)

Avatar image for kaleotter
KaleOtter

5

Forum Posts

0

Wiki Points

1

Followers

Reviews: 0

User Lists: 0

Hey, I'm Kale, 31. Studying at college. Pretty typical overweight tabletop playing ADHD nerd. I actually came here to poke around the API as part of a project for my course, but I think I'll hang around a bit and see what else I like.

Obviously I'm interested in videogames and programming (though I am not brilliant at it and I write miles of spaghetti), and pen and paper RPGs. I also like to read sci-fi and fantasy.

I guess theres not too much more to say, but I'm always looking for new stuff to do, so poke me if you see something you wanna chat about :)

Avatar image for kaleotter
KaleOtter

5

Forum Posts

0

Wiki Points

1

Followers

Reviews: 0

User Lists: 0

#4  Edited By KaleOtter

I would have to say that it was probably No mans Sky and X:Rebirth that made me think a lot more about weather or not to pre-order a game, especially just on genre. Now I rarely pre-order anything.

Though more than this, I've stopped pre-ordering as part of a drive to get my impuse control issues under control. I rarely read previews about games I might want and mostly consider for a long time weather I can afford it, and weather its worth buying anything basically sight-unseen.