| CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Thu, 25 Dec 2025 08:33:15 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20100726105442
location: https://web.archive.org/web/20100726105442/https://github.com/synack/python-digg
server-timing: captures_list;dur=0.672051, exclusion.robots;dur=0.049007, exclusion.robots.policy;dur=0.037678, esindex;dur=0.009841, cdx.remote;dur=21.165087, LoadShardBlock;dur=781.151946, PetaboxLoader3.datanode;dur=57.244773, PetaboxLoader3.resolve;dur=93.958409
x-app-server: wwwb-app217-dc8
x-ts: 302
x-tr: 835
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app217; path=/
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Thu, 25 Dec 2025 08:33:16 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Mon, 26 Jul 2010 10:54:42 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-etag: "8e98b1d776946bcd45599c77181af9d3"
x-archive-orig-x-runtime: 170ms
x-archive-orig-content-length: 25139
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Mon, 26 Jul 2010 10:54:42 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_17_20100726102624_crawl103-c/52_17_20100726105334_crawl101.arc.gz
server-timing: captures_list;dur=1.090773, exclusion.robots;dur=0.014892, exclusion.robots.policy;dur=0.007467, esindex;dur=0.008711, cdx.remote;dur=30.023795, LoadShardBlock;dur=81.776578, PetaboxLoader3.datanode;dur=130.402149, load_resource;dur=228.787960, PetaboxLoader3.resolve;dur=141.730106
x-app-server: wwwb-app217-dc8
x-ts: 200
x-tr: 391
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
synack's python-digg at master - GitHub
synack / python-digg
- Source
- Commits
- Network (2)
- Issues (0)
- Downloads (2)
- Wiki (1)
- Graphs
-
Branch:
master
click here to add a description
click here to add a homepage
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Loading commit data... |
|
| |
LICENSE | ||
| |
README.mkd | ||
| |
debian/ | ||
| |
digg/ | Mon Jun 07 01:00:22 -0700 2010 | Make caching code a bit less naive [synack] |
| |
setup.py | ||
| |
test.py |
README.mkd
Installing
# easy_install https://github.com/downloads/synack/python-digg/python-digg-1.1.tar.gz
easy_install will download and install python-digg and all of the required dependencies on it's own.
Required dependencies
- oauth2 (https://github.com/simplegeo/python-oauth2)
- simplejson (only if you're using Python 2.5, optional for 2.6 and up)
Optional dependencies
- python-memcached (https://pypi.python.org/pypi/python-memcached/)
Usage
Simple example
from digg.api import Digg
digg = Digg()
for story in digg.story.getPopular(count=20, topic='apple')['stories']:
print story['title']
print '%i diggs, %i comments' % (story['diggs'], story['comments'])
OAuth example
Digg's API requires an OAuth access token in order to authenticate a user with certain methods (eg. story.digg). Note that this procedure is subject to change in future releases, especially the ugly parse_qs nonsense.
from urlparse import parse_qs
import sys
from oauth2 import Consumer, Token
from digg.api import Digg
consumer = Consumer(key='myoauthconsumerkey', secret='myoauthconsumersecret')
digg = Digg(oauth_consumer=consumer)
response = digg.oauth.getRequestToken(oauth_callback='oob')
request_token = parse_qs(response)
print 'Please visit the following URL to authorize this application'
print 'https://digg.com/oauth/authorize?oauth_token=%s' % request_token['oauth_token'][0]
sys.stdout.write('Type the verification number: ')
verifier = sys.stdin.readline().rstrip('\r\n')
request_token = Token(request_token['oauth_token'][0], request_token['oauth_token_secret'][0])
request_token.set_verifier(verifier)
response = digg.oauth.getAccessToken(oauth_token=request_token)
response = parse_qs(response)
access_token = Token(response['oauth_token'][0], response['oauth_token_secret'][0])
print digg.oauth.verify(oauth_token=access_token)
print digg.story.digg(id=22091157, oauth_token=access_token)

