-1
FEEDLY_REDIRECT_URI = "http://fabreadly.com/auth_callback" 
FEEDLY_CLIENT_ID="dddbc310-815b-4455-a90a-adc02407e548"
FEEDLY_CLIENT_SECRET="client_secret"


token="AzvF1tlmFnsO4jbY5pWZoJR5B10DmESgdzG0Ja_hQNLl5zzp53ilhXkbMZISbBmfQXjJ7zOeROU0XRCHKS06zfs2lclcehXgz4OGUkY5flB6HJrEHPSr9rtjsO99O3d9RG3W05S8aJTQHtVf9hGpFBa6xSLuyWDTNLAN1bbP_xqkg9IoIHys6zVqKHu7xNqPsKw1OFsDXR4pSobPUGWtOUMkkQLF8clKP83Pq7xP-ithXnavMsYA82mSOr3w:feedlydev"

def feed(access_token):
    '''get user's subscription'''
    feedly = get_feedly_client()
    user_subscriptions = feedly.get_user_subscriptions(access_token)
feeds=feed(token)
4

1 回答 1

-1

查看以下示例,该示例取自: https ://colab.research.google.com/drive/1jUpGwTaY9vJsUVw1tgwwXqKz6UOsvV1a

from feedly.api_client.session import FeedlySession
from feedly.api_client.data import StreamOptions, Streamable
import urllib3
urllib3.disable_warnings()

FEEDLY_CLIENT_ID="XXX"
FEEDLY_CLIENT_SECRET= "XXX"

# TODO: Enter your feedlyToken here
token = FEEDLY_CLIENT_SECRET

if token is None:
    raise ValueError("Please enter a token")

# initialize session
sess = FeedlySession(auth=token)

# print the names of all your feeds (categories) and boards (tags)
print("Personal feeds:")
for category_uuid, category_data in sess.user.get_categories().items():
    print("\t", f'"{category_uuid}"', f"({category_data})")

print("Personal boards:")
for tag_name in sess.user.get_tags():
    print("\t",f'"{tag_name}"')


### print the titles of some articles

# get your first category
personal_category_uuid = list(sess.user.get_categories().keys())[0]
print("Personal categories:" + personal_category_uuid)

# download articles
entries = sess.user.get_category(personal_category_uuid).stream_contents()
entries = list(entries)

# get the titles in the json property
print(f"Articles from your personal feed '{personal_category_uuid}':")
for entry in entries[2:5]:
    print("\t"+entry.json["title"])
    print()

它可能会帮助你。

于 2019-09-18T13:04:33.140 回答