Skip to content

Instantly share code, notes, and snippets.

@wakiyamap
Last active November 24, 2022 00:45
Embed
What would you like to do?
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