Created
July 31, 2015 03:28
-
-
Save hondajojo/6075fbb5152d56d55644 to your computer and use it in GitHub Desktop.
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 -*- | |
import requests | |
import urllib | |
import sys | |
import json | |
if len(sys.argv) == 2: | |
quote_url = urllib.quote_plus(sys.argv[-1]) | |
#print quote_url | |
long_url = 'https://feedly.com//v3/search/auto-complete?cv=28.0.982&ck=1' \ | |
'437809329022&locale=en-US&query=' + quote_url + '&sites=6&topics=0&libra' \ | |
'ries=0' | |
headers = {'User-Agent':'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.3'\ | |
'6 (KHTML, like Gecko) Chrome/44.0.2403.89 Safari/537.36'} | |
#response = requests.get(long_url,headers=headers,verify=False).content | |
response = urllib.urlopen(long_url).read() | |
items = json.loads(response) | |
a = items.get('sites') | |
#print items | |
for i in a: | |
#print '\n' | |
print i.get('feedId').split('feed/',1)[-1] | |
print i.get('subscribers') | |
else: | |
print 'please put url' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment