The feedly Cloud APIではてなブックマークお気に入りのタイトルを表示

f:id:fedora9:20201027201316p:plain

The feedly Cloud API

 

以下のリンクを開き、Googleのhiroyuki12でログインして、developer access tokenを取得

feedly cloud | developer

Gmailに届いたメールのリンクを開いてdeveloper access tokenを取得。 

 

Developer Access Tokens | feedly Cloud API

 

Feedly APIAWS Lambdaから実行する) 

リージョン us-east-1 で作成した

Lambda - CallFeedlyAPI -設定 - 環境変数で設定

 

 

profileを取得して表示

$ curl -H "Authorization: OAuth yourAccessTokenValueGoesHere" https://cloud.feedly.com/v3/profile

Overview | feedly Cloud API v3

 

Terminalでjsonを整形して表示できるようにjqをインストールする。

$ b jq

Macでjsonを見やすく整形する方法 - Qiita

 

フィードの未読数を取得

$ curl -H "Authorization: OAuth yourAccessTokenValueGoesHere" https://cloud.feedly.com/v3/markers/counts | jq

Feedly APIメモ - Qiita

 

BORDS一覧を取得

$ curl -H "Authorization: OAuth yourAccessTokenValueGoesHere" https://cloud.feedly.com/v3/boards | jq

 

collections(FEEDSの下にあるカテゴリ)一覧を取得(feedsのfeedid他も取得)

$ curl -H "Authorization: OAuth yourAccessTokenValueGoesHere" https://cloud.feedly.com/v3/collections | jq

 

categories(FEEDSの下にあるカテゴリ)一覧を取得 (idとlabelとcreatedのみ)

$ curl -H "Authorization: OAuth yourAccessTokenValueGoesHere" https://cloud.feedly.com/v3/categories | jq

How to get all unread items using Feedly API - Stack Overflow

 

⭐️categoryがItの未読の記事のタイトル他を取得

$ curl -H "Authorization: OAuth yourAccessTokenValueGoesHere"  'https://cloud.feedly.com/v3/streams/contents?streamId=user/yourUserIdGoesHere/category/It&unreadOnly=true' | jq

How to get all unread items using Feedly API - Stack Overflow

 

⭐️categoryがglobal.uncategorizedの記事のタイトル他を取得

$ curl -H "Authorization: OAuth yourAccessTokenValueGoesHere"  'https://cloud.feedly.com/v3/streams/contents?streamId=user/yourUserIdGoesHere/category/global.uncategorized' | jq

yourAccessTokenValueGoesHereと yourUserIdGoesHereは実際の値に置き換え

 

ios - How to set a 'Token xxxxxxxxxx' for 'Authorization' in HTTP header in URLSession - Stack Overflow

    let url: URL = URL(string: str7)!

    var request = URLRequest(url: url)

    request.setValue(Constants.feedlyDeveloperToken, forHTTPHeaderField: "Authorization")

    let task: URLSessionTask  = URLSession.shared.dataTask(with: request, completionHandler: {data, response, error in

 

リンクのURLはalternateの下のhrefにある

    let array = articles[indexPath.row]["alternate"] as! NSArray

    for roop in array {

      let next = roop as! NSDictionary

      //print(next["href"])

      webView.url = next["href"] as? String

    }

Swift - NSSingleObjectArrayIとは?|teratail

 

Swiftで日時文字列とUNIX時間を相互に変換する方法 - Qiita

    // セルに表示する作成日を設定する

    let tagsText = cell.viewWithTag(4) as! UILabel

    let dateUnix = (article["published"]! as? Double)! / 1000 // items->creation_date

    let date = NSDate(timeIntervalSince1970: dateUnix)

    let formatter = DateFormatter()

    formatter.dateFormat = "yyyy-MM-dd HH:mm:ss"

    let dateStr: String = formatter.string(from: date as Date)

    tagsText.text = author + " " + daysAgo(dateStr)

 

curl コマンド 使い方メモ - Qiita

$ curl -H

 

Streams | feedly Cloud API

continuation=publishedの値

publishedの値より前の記事を取得

https://cloud.feedly.com/v3/streams/contents?streamId=user/" + Constants.feedlyUserId + "/category/global.uncategorized&continuation=" + continuation

 

はてなスタッフ - はてなブログ グループ

feedlyのCreate New Feedでcategoryを作成

Addで追加

$ curl -H "Authorization: OAuth yourAccessTokenValueGoesHere" https://cloud.feedly.com/v3/categories | jq

で、idのcategoryの後ろを確認

 

はてなブログ グループのRSSフィード - Sprint Life

 

Feedly にはてなブックマーク数を表示する Chrome 拡張 - yunica's blog

 

sandbox

FeedlyClient/Constants.swift at 8c74a5b1d6840e459c113f6a1134ad8e3086d890 · florinmunteanu/FeedlyClient · GitHub

 

Swiftの記事一覧 | Zenn

 

Next.js から Feedly API を叩いて記事データを取得する | WWW WATCH