Register RSS with api call to Feedly

![banner-feedly.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/144058/5ea3c7ce-b46d-41f5-c7c3-2a7ff17cd299.jpeg)

### ✍ Intro
> I recorded how to register rss with api calls to [Feedly](https://feedly.com).
> I used [python](https://www.python.org/).

### Test environment
- Python 3.7.4

### Precondition
**`access token`** is required.
1. https://developer.feedly.com/v3/developer/ > Start here
![feedly01.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/144058/9f21a060-4512-40c3-4443-814fffeff614.png)
2. Sign in (ex: Google)
![feedly02-1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/144058/a03022e4-1c80-42a9-c715-d95f7a5db514.png)
![feedly02-2.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/144058/c467568d-e078-ce50-d9d0-f363f59fc151.png)
![feedly03.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/144058/ad5b58af-40a0-251b-6967-709143f1b7d0.png)
3. Check Email > Click link
![feedly04.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/144058/2d727dad-220a-6447-d7b8-7599a0e93ae3.png)
4. Get `access token` 🔑
![feedly05.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/144058/dfb5f609-a669-fa25-d102-7079efd6b121.png)
**`id`** is also required.
- Get `id` 👌 
Click Feed(ex: FROM-API) to get '/user...' id from url.
![feedly06.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/144058/4e720c89-6198-a177-3158-5197431f8ef6.png)

### Execution
#### Pre installation
```bash
$ pip install requests
```
#### Source code
```bash
$ vi add_rss.py
```
```python
import requests
import json

access_token = 'AyxlSuDt3...8iw8u3vDqsxjU:feedlydev' # your token

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
```bash
$ python ./add_rss.py
```
```bash
[{"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"}]
```
![feedly07.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/144058/b07c4b9d-6d77-7a56-c11d-a5dcf88f7085.png)

### Quota
- Free users : max 250 api requests per day 😅
- Pro&Team : max 500 api requests per day