NI-Lab.

nilog:

← 前の日 2020-09-05 次の日 →
← 一年前 一年後 →
Twitter (2020-09-05)
「snowflake-based IDが与えられるツイートに加え、2011年9月30日からはダイレクトメッセージにも snowflake 64-bit 整数が割り振られるように」「Javascript のような一部のプログラム言語は53bitsの数字をサポートしていない」

Twitter IDs - Twitter 開発者ドキュメント https://westplain.sakuraweb.com/translate/twitter/API-Overview/Twitter-IDs.cgi
[t] 2020-09-05 12:30:23
関連するかも情報
「JSONを使用してAPIを実行する場合、idフィールドではなく常に id_strフィールドを使用」「JSONを扱うJavascript やその他プログラミング言語における、桁の大きな数字を処理する方法がネックとなっているからです」

Twitter IDs - Twitter 開発者ドキュメント 日本語訳 https://westplain.sakuraweb.com/translate/twitter/API-Overview/Twitter-IDs.cgi
[t] 2020-09-05 12:29:44
「snowflake-based IDが与えられるツイートに加え、2011年9月30日からはダイレクトメッセージにも snowflake 64-bit 整数が割り振られるように」「Javascript のような一部のプログラム言語は53bitsの数字をサポートしていない」

Twitter IDs - Twitter 開発者ドキュメント https://westplain.sakuraweb.com/translate/twitter/API-Overview/Twitter-IDs.cgi
[t] 2020-09-05 12:30:23
「Javascriptで開発している場合は、コードを更新して数値ではなく文字列を読み込むようにする」
「プログラム言語のパーサーによっては、IDの値を読み込んだ時にJSONで例外が発生することがあります」

Twitter IDs - Twitter 開発者ドキュメント 日本語訳 https://westplain.sakuraweb.com/translate/twitter/API-Overview/Twitter-IDs.cgi
[t] 2020-09-05 12:30:31
「JavaScript コードにおける 37 のような数値リテラルは浮動小数点値であり、整数ではありません。日常的に使用される独立した整数型はありません」

Number - JavaScript | MDN https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Number
[t] 2020-09-05 12:32:46
「JavaScript は BigInt 型を持つようになりましたが、日常の利用で Number を置き換えるように設計されてはいません。 37 は Number であり、 BigInt ではありません」

Number - JavaScript | MDN https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Number
[t] 2020-09-05 12:32:46
「Number.MAX_SAFE_INTEGER 定数は、JavaScript における安全な整数の最大値 (2⁵³ - 1) を表します」

Number.MAX_SAFE_INTEGER - JavaScript | MDN https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
[t] 2020-09-05 12:35:09
$ node
Welcome to Node.js v14.7.0.
Type ".help" for more information.
> Number.MAX_SAFE_INTEGER
9007199254740991
> Number.MIN_SAFE_INTEGER
-9007199254740991
>
(To exit, press ^C again or ^D or type .exit)
>

なるほど。
[t] 2020-09-05 12:39:06
【天気】今日の名古屋 ☀☁
9/5(土) 晴れのちくもり
予想最高気温:35℃
降水確率
12-18時:20%
18-24時:40%
ウェザーマップ気象情報 http://www.weathermap.co.jp/forecast/
#天気bot #bot #052tenki #aichi
[t] 2020-09-05 13:00:56
先日の Evernote の不調もあっていいかげん Evernote の API を使ってみようと思うようになってる。仕組みを知っていればいろいろ考える幅が広がるはず。
[t] 2020-09-05 13:44:38
とりあえず Python でやってみたい。

Evernote Cloud API — Python Quick-start Guide - Evernote Developers https://dev.evernote.com/doc/start/python.php
[t] 2020-09-05 13:45:16
開発にはここの sandbox サーバを使うらしい。

"Evernote’s development server. You’ll be connecting to this server while your application is in development."

ようこそ https://sandbox.evernote.com/Login.action?targetUrl=%2FHome.action%3F
[t] 2020-09-05 13:46:45
あれっ? sandbox 用にアカウントを作らないといけなさそう。それはちょっとな。。。

"入力されたユーザ名またはメールアドレスに紐付いたアカウントはありません。"
[t] 2020-09-05 13:47:52
APIキー or デベロッパートークンのどちらか。

「発行されたAPIキーを使ってOAuthを実装」
「デベロッパートークンは1年間の期限付き認証トークンで、OAuthを実装することが不要」

Pythonで使って覚えるEvernote API (1/6):CodeZine(コードジン) https://codezine.jp/article/detail/10055
[t] 2020-09-05 13:52:57
Developer tokens のほうがラクそう。

"There are two ways to authenticate to the Evernote API, developer tokens and OAuth. Developer tokens provide instant access to your Evernote account via the API."

Developer Tokens - Evernote Developers https://dev.evernote.com/doc/articles/dev_tokens.php
[t] 2020-09-05 13:54:29
えー。なんで使えないのか理由を表示してほしいわ。。。

"Update: the creation of developer tokens is temporarily disabled."
[t] 2020-09-05 13:58:51
Evernote の Developer Tokens ページ。

Developer Tokens https://www.evernote.com/api/DeveloperToken.action
[t] 2020-09-05 14:09:05
まず右上の "GET AN API KEY" から API Key を入手しないといけなさそう。API Permissions: Full Access を選択。あとは適当に埋めたらすぐに Consumer Key と Consumer Secret をゲットできた。

Home - Evernote Developers https://dev.evernote.com/ https://twitter.com/nilab/status/1302112505469177864/photo/1
まず右上の "GET AN API KEY" から API Key を入手しないといけなさそう。API Permissions: Full Access を選択。あとは適当に埋めたらすぐに Consumer Key と Consumer Secret をゲットできた。  Home - Evernote Developers
元の画像を見る
[t] 2020-09-05 14:13:08
"Activate an API Key" のボタンからだいぶ簡易的に諸情報を入力して Activation Request した。使えるようになるのに何日かかかるのかなぁ。。。

Support - Evernote Developers https://dev.evernote.com/support/
[t] 2020-09-05 14:18:36
Python ライブラリが「This is a test SDK」なんて書かれてるんだけどまさかいまだに Python 2 をメインにしているなんてないよね。。。

"This is a test SDK!"

GitHub - evernote/evernote-sdk-python3: Testing the Evernote Cloud API for Python 3 https://github.com/evernote/evernote-sdk-python3
[t] 2020-09-05 14:21:58
Java のライブラリのメインのソースコードの最終更新は7年前。枯れていると思っていいのか、あるいはメンテされていないのか。。。

GitHub - evernote/evernote-sdk-java: Evernote SDK for Java https://github.com/evernote/evernote-sdk-java
[t] 2020-09-05 14:25:59
2020年09年05日のnilogをすべて表示する

- NI-Lab.
- Mastodon (@nilab@mastodon-japan.net)
- Twitter (@nilab)
- Timelog (@nilab)
- はてなブックマーク (id:nilab)

Web Services by Yahoo! JAPAN