Google 리더에 API가 있습니까? 그렇다면 특정 사용자의 사용자 이름과 비밀번호를 알 수있는 읽지 않은 게시물 수를 계산하려면 어떻게해야합니까?Google 리더 API 읽지 않음 횟수
26
A
답변
45
이 URL은 피드 당 읽지 않은 글 수를 제공합니다. 그런 다음 피드를 반복하여 카운트를 합산 할 수 있습니다.
import urllib
import urllib2
username = '[email protected]'
password = '******'
# Authenticate to obtain SID
auth_url = 'https://www.google.com/accounts/ClientLogin'
auth_req_data = urllib.urlencode({'Email': username,
'Passwd': password,
'service': 'reader'})
auth_req = urllib2.Request(auth_url, data=auth_req_data)
auth_resp = urllib2.urlopen(auth_req)
auth_resp_content = auth_resp.read()
auth_resp_dict = dict(x.split('=') for x in auth_resp_content.split('\n') if x)
auth_token = auth_resp_dict["Auth"]
# Create a cookie in the header using the SID
header = {}
header['Authorization'] = 'GoogleLogin auth=%s' % auth_token
reader_base_url = 'http://www.google.com/reader/api/0/unread-count?%s'
reader_req_data = urllib.urlencode({'all': 'true',
'output': 'xml'})
reader_url = reader_base_url % (reader_req_data)
reader_req = urllib2.Request(reader_url, None, header)
reader_resp = urllib2.urlopen(reader_req)
reader_resp_content = reader_resp.read()
print reader_resp_content
그리고 몇 가지 추가 링크 : 여기
는 XML/JSON을 구문 분석하고 수를 합산하여 독자들에게 연습 문제로 남겨 ... 파이썬에서 미니멀 한 예이다 주제 :
11
0
6
http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI가 업데이트 this answer
import urllib
import urllib2
username = '[email protected]'
password = '******'
# Authenticate to obtain Auth
auth_url = 'https://www.google.com/accounts/ClientLogin'
#auth_req_data = urllib.urlencode({'Email': username,
# 'Passwd': password})
auth_req_data = urllib.urlencode({'Email': username,
'Passwd': password,
'service': 'reader'})
auth_req = urllib2.Request(auth_url, data=auth_req_data)
auth_resp = urllib2.urlopen(auth_req)
auth_resp_content = auth_resp.read()
auth_resp_dict = dict(x.split('=') for x in auth_resp_content.split('\n') if x)
# SID = auth_resp_dict["SID"]
AUTH = auth_resp_dict["Auth"]
# Create a cookie in the header using the Auth
header = {}
#header['Cookie'] = 'Name=SID;SID=%s;Domain=.google.com;Path=/;Expires=160000000000' % SID
header['Authorization'] = 'GoogleLogin auth=%s' % AUTH
reader_base_url = 'http://www.google.com/reader/api/0/unread-count?%s'
reader_req_data = urllib.urlencode({'all': 'true',
'output': 'xml'})
reader_url = reader_base_url % (reader_req_data)
reader_req = urllib2.Request(reader_url, None, header)
reader_resp = urllib2.urlopen(reader_req)
reader_resp_content = reader_resp.read()
print reader_resp_content
에 "T"이어야
Google 리더는 2010 년 6 월경 SID auth가 제거되었습니다. ClientLogin의 새로운 인증을 사용하는 것이 새로운 방법이며 조금 더 간단합니다 (헤더가 짧음) . Auth
을 요청하기 위해 service
을 데이터에 추가해야합니다. service=reader
을 보내지 않으면 Auth
이 반환됩니다.
this thread에서 인증 방법 변경에 대한 자세한 내용을 볼 수 있습니다.
관련 문제
- 1. Google 리더 읽지 않은 횟수
- 2. Google 리더 API가 항목을 읽지 않음으로 표시합니다.
- 3. Google 리더 API PHP 라이브러리
- 4. Google 리더 API - 피드 받기
- 5. Google 리더 OAuth 표시를 읽음으로
- 6. Google 리더 API - 모두 읽음으로 표시
- 7. Google 리더 API 단일 항목 가져 오기
- 8. Google 리더 API 피드 항목 수
- 9. Google 리더 수정 API 인증 문제
- 10. Google 리더 API 토큰이 만료 되나요?
- 11. Google 리더 API 독자의 사용자 ID를 Google 계정에 연결하기
- 12. Google 리더 API - feed/[FEEDURL]/다시 찾을 수 없음으로 돌아옴
- 13. Google 크롬 확장 : 알림 시스템, RSS 리더
- 14. Google 리더 API 요청 토큰, get 400 : 잘못된 요청
- 15. Google 리더 API - 항목 ID에 반대하는 기사 URL로 어떻게 공유합니까?
- 16. Google 리더 API : 스트림/아이템/ID 연속 계속
- 17. Google 리더 API의 URL 길이 한도
- 18. Android 자산 가치 읽지 않음?
- 19. ClientLogin으로 인증하고 Android에서 Google 리더 API를 사용합니다.
- 20. Google 리더 테스트 코드에서 무엇을 놓치셨습니까?
- 21. 피드 리더 업데이트 (예 : Google 리더 또는 Bloglines)
- 22. 자바 Google 알리미 API
- 23. 지난 1 시간 동안 Google 리더 API를 사용하여 읽지 않은 기사를받는 방법
- 24. Google 보이스 및 읽지 않은 읽지 않은 SMS 메시지 읽기
- 25. GQL (Google App Engine)의 재설정 횟수
- 26. ePub 리더 API iPhone/iPad 용
- 27. iPhone 앱의 출시 횟수
- 28. 어디에 rss 읽기/읽지 않음 상태가
- 29. 포럼 게시물 "읽음"과 "읽지 않음"
- 30. Google 리더 API를 사용하여 더 자세히 알아보기
@GateKiller : "코드 요청"태그를이 코드에 던지려는 동기를 이해합니다 ... 유일한 답변은 (깨진) API 문서에 대한 링크 인 질문에 열린 현상금이 있습니다. 내 키워드를 인터넷으로 검색 한 사람에게 300 원을 지불해야한다는 것을 나에게 짜증나게한다. – Shog9
그러나 태그는 어떤 용도로도 사용되지 않습니다. 오히려 샘플 코드를 감상 할 수 있다는 메모를 실제 질문에 추가해야합니다. – Shog9