Created
January 1, 2022 01:35
-
-
Save mint149/6d4fc1ad0b902b47f659c67866cd6b1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
consumer_key = "YOUR_CONSUMER_KEY" | |
access_token = "YOUR_ACCESS_TOKEN" | |
path = "oneTabUrls.txt" | |
with open(path) as file: | |
lines = file.readlines() | |
urls = [line.split(' | ')[0] for line in lines] | |
filteredUrls = filter(lambda url: url != '\n', urls) | |
for target in filteredUrls: | |
url = "https://getpocket.com/v3/add" | |
payload = { | |
"consumer_key": consumer_key, "access_token": access_token, "url": target | |
} | |
print(requests.post(url, params=payload).text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment