Skip to content

Instantly share code, notes, and snippets.

@wakiyamap
Last active November 24, 2022 00:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wakiyamap/9b22839666f2120be882449cbcf84c72 to your computer and use it in GitHub Desktop.
Save wakiyamap/9b22839666f2120be882449cbcf84c72 to your computer and use it in GitHub Desktop.
import re
import requests
endpoint = "http://127.0.0.1:5001/api/v0/pin/add"
url= "https://card.mona.jp/api/cid_list"
response = requests.get(url)
parse_data = re.finditer(r'"cid":"([a-z0-9]+)"', response.text)
for m in parse_data:
r = requests.post(endpoint + "?arg=" + m[1],)
print(r.url)
@cryptcoin-junkey
Copy link

Another method for Unix one-liners.

curl https://card.mona.jp/api/cid_list | jq -r .list[].cid | xargs ipfs pin add --progress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment