[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
anybody know about json + urllib2 ?
From: |
Graham Percival |
Subject: |
anybody know about json + urllib2 ? |
Date: |
Mon, 26 Sep 2011 02:15:54 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Does anybody have a passing familiarity with json? I'm having
trouble getting started with rietveld json api. I'm going to work
on the code.google.com python interaction for the rest of today,
but it would be great if somebody could get the json thing
started.
Task: get a basic "hello world" with riteveld working. Once I've
got that, the rest is (relatively) simple. The following python
script gives me no joy; it just returns the main webpage.
#!/usr/bin/env python
import urllib2
url = "http://codereview.appspot.com"
data = "/api/5096046"
request = urllib2.Request(url, data)
response = urllib2.urlopen(request).read()
print response
Various help pages below, but I think I'm missing something
fundamental about how json works. I'm particularly wondering
about urls.py, since I can't figure out what it's doing but it
looks important.
http://code.google.com/p/rietveld/wiki/APIs
http://code.google.com/p/rietveld/source/browse/codereview/urls.py
http://developer.yahoo.com/python/python-json.html
Cheers,
- Graham
- anybody know about json + urllib2 ?,
Graham Percival <=