3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

はてなブックマークを #API で追加する #python スクリプトの例

Last updated at Posted at 2019-02-16

はてなブックマークを #API で追加する #python スクリプトの例

Script

import requests

from requests_oauthlib import OAuth1
auth = OAuth1(
  "cosumer_key",
  "consumer_secret",
  "AccessToken",
  "AccessTokenSecret"
)

bookmark_api_url = "http://api.b.hatena.ne.jp/1/my/bookmark"
bookmark_url = "https://example.com/"
print(requests.post(bookmark_api_url + "?url=" + bookmark_url, auth=auth).content)

Example

image

Ref

はてなブックマーク ブックマーク API - Hatena Developer Center
はてなのOAuth API用のアクセストークンを簡単に取得する [python] - Iruca Log

Original by Github issue

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?