Register rss with api call to Feedly

·2020년 1월 10일
0

Feedly

목록 보기
1/1
post-thumbnail

✍ Intro

I recorded how to register rss with api calls to Feedly.
I used python.

Test environment

  • Python 3.7.4

Precondition

access token is required.
1. https://developer.feedly.com/v3/developer/ > Start here

2. Sign in (ex: Google)



3. Check Email > Click link

4. Get access token 🔑

id is also required.

  • Get id 👌
    Click Feed(ex: FROM-API) to get '/user...' id from url.

Execution

Pre installation

$ pip install requests

Source code

$ vi add_rss.py
import requests
import json

access_token = 'AyxlSuDt3...8iw8u3vDqsxjU:feedlydev' # skip

headers = {
    'Authorization': 'OAuth ' + access_token
}

feed_url = "feed/" + "http://feeds.feedburner.com/Techcrunch" # Techcrunch rss url
name = "Techcrunch Blog"

data = {
    # FROM-API
    "id": "user/9211547f-644f-43a4-abad-77b184ce7d2b/category/c93b4c22-c73b-42d0-99c2-3fa1686da6b4",
    "feeds": [
        {
            "id": feed_url,
            "title": name
        }
    ]
}

res = requests.post('https://cloud.feedly.com/v3/collections', headers=headers, data=json.dumps(data), verify=False)
print (res.text)

💻 Execution Result

$ python ./add_rss.py
[{"customizable":true,"feeds":[{"id":"feed/http://feeds.feedburner.com/Techcrunch","feedId":"feed/http://feeds.feedburner.com/Techcrunch","title":"Techcrunch Blog","updated":1578669433716,"velocity":147.9,"topics":["tech"],"subscribers":1094984,"website":"https://techcrunch.com","partial":false,"estimatedEngagement":211,"contentType":"longform","language":"en","description":"TechCrunch is a group-edited blog that profiles the companies, products and events defining and transforming the new web."}],"label":"FROM-API","created":1578667348184,"enterprise":false,"numFeeds":1,"id":"user/9211547f-644f-43a4-abad-77b184ce7d2b/category/c93b4c22-c73b-42d0-99c2-3fa1686da6b4"}]

Quota

  • Free users : max 250 api requests per day 😅
  • Pro&Team : max 500 api requests per day

0개의 댓글