Skip to content

Instantly share code, notes, and snippets.

@mint149
Created January 1, 2022 01:35
Show Gist options
  • Save mint149/6d4fc1ad0b902b47f659c67866cd6b1c to your computer and use it in GitHub Desktop.
Save mint149/6d4fc1ad0b902b47f659c67866cd6b1c to your computer and use it in GitHub Desktop.
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