Created
March 2, 2010 15:12
-
-
Save voyeg3r/319567 to your computer and use it in GitHub Desktop.
getpopular - get popular tags from delicious
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# # -*- coding: UTF-8 -*- | |
# Criado em:Ter 02/Mar/2010 hs 11:58 | |
# Last Change: Ter 02 Mar 2010 18:18:43 BRT | |
# vim:ft=python:nolist:nu: | |
# Instituicao: none | |
# Proposito do script: pesquisar tags populares no delicious | |
# Autor: Sérgio Luiz Araújo Silva | |
# site: http://vivaotux.blogspot.com | |
# versão 1.3 | |
# instale pydelicious | |
# sudo su - | |
# apt-get install -y python-setuptools | |
# easy_install -z http://pydelicious.googlecode.com/files/pydelicious-0.6.zip | |
import sys | |
# como o módulo pydelicious pode não estar instalado coloquei este try/except | |
try: | |
import pydelicious | |
except ImportError: | |
print " " | |
print " você tem que instalar primeiro a biblioteca pydelicious" | |
print " sudo easy_install -z http://pydelicious.googlecode.com/files/pydelicious-0.6.zip" | |
print " " | |
sys.exit(1) | |
if len(sys.argv) != 2: | |
print ' Uso: %s tag' % sys.argv[0] | |
sys.exit(1) | |
populares=pydelicious.get_popular(tag=str(sys.argv[1])) | |
print "\n".join([ x.get('url') for x in populares] ) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment