| CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Thu, 25 Dec 2025 04:29:49 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20100723121834
location: https://web.archive.org/web/20100723121834/https://github.com/synack/python-digg
server-timing: captures_list;dur=0.572912, exclusion.robots;dur=0.053799, exclusion.robots.policy;dur=0.045443, esindex;dur=0.010796, cdx.remote;dur=11.851842, LoadShardBlock;dur=198.131810, PetaboxLoader3.datanode;dur=87.182186, PetaboxLoader3.resolve;dur=62.375536
x-app-server: wwwb-app242-dc8
x-ts: 302
x-tr: 237
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app242; 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 04:29:55 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Fri, 23 Jul 2010 12:18:34 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-etag: "765f0dd7640e45236921ae92d1bec1d8"
x-archive-orig-x-runtime: 234ms
x-archive-orig-content-length: 24982
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: Fri, 23 Jul 2010 12:18:34 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_16_20100723105355_crawl101-c/52_16_20100723121741_crawl101.arc.gz
server-timing: captures_list;dur=1.292804, exclusion.robots;dur=0.034172, exclusion.robots.policy;dur=0.021686, esindex;dur=0.010250, cdx.remote;dur=8.491448, LoadShardBlock;dur=301.341449, PetaboxLoader3.datanode;dur=5231.594730, PetaboxLoader3.resolve;dur=50.096952, load_resource;dur=5121.998741
x-app-server: wwwb-app242-dc8
x-ts: 200
x-tr: 5508
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)

