I am extremely new to coding in general; I delved into this project to help my friend tag her fifteen thousand and a few extra posts on Tumblr. We are finally done, but she wants to be sure that we haven’t missed anything ... So, I browsed the Internet, trying to find a solution for encoding. I came across a script found here that supposedly does exactly what we need - so I downloaded Python and ... It doesn't work.
More specifically, when I click on the script, the black box appears for about a second and a half, and then disappears. I could not take a screenshot to find out what it says, but I believe there is a syntax error. At first I tried with Python 2.4; it didn't seem to find the Json module the creator uses, so I switched to Python 3.3, the latest version for Windows, and that is where the syntax errors happen.
#!/usr/bin/python
import urllib2
import json
hostname = "(Redacted for Privacy)"
api_key = "(Redacted for Privacy)"
url = "http://api.tumblr.com/v2/blog/" + hostname + "/posts?api_key=" + api_key
def api_response(url):
req = urllib2.urlopen(url)
return json.loads(req.read())
jsonresponse = api_response(url)
post_count = jsonresponse["response"]["total_posts"]
increments = (post_count + 20) / 20
for i in range(0, increments):
jsonresponse = api_response(url + "&offset=" + str((i * 20)))
posts = jsonresponse["response"]["posts"]
for i in range(0, len(posts)):
if not posts[i]["tags"]:
print posts[i]["post_url"]
print("All finished!")
, : , , Untagged Posts on Tumblr, ?
( Tumblr, Python), - script Tumblr? Tumblr, , .
, , Python C:\Python33.
.