The feedly Cloud APIではてなブックマークお気に入りのタイトルを表示
以下のリンクを開き、Googleのhiroyuki12でログインして、developer access tokenを取得
Gmailに届いたメールのリンクを開いてdeveloper access tokenを取得。
Developer Access Tokens | feedly Cloud API
リージョン 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
フィードの未読数を取得
$ curl -H "Authorization: OAuth yourAccessTokenValueGoesHere" https://cloud.feedly.com/v3/markers/counts | jq
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は実際の値に置き換え
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 -H
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