Skip to content

Instantly share code, notes, and snippets.

@marcusps
Last active August 8, 2016 17:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcusps/d0d88d89267fd7167f05 to your computer and use it in GitHub Desktop.
Save marcusps/d0d88d89267fd7167f05 to your computer and use it in GitHub Desktop.
Convert your Svpply data into a Tumblr blog

Svpply to Tumblr

Svpply is a neat service that, in essence, allowed people to track and share items they wanted. In essence, it is a wishlist service that works across all sites, and captures the price and the image of the item you want.

Svpply is shutting down, but gladly they are allowing users to download their data -- in essence, all the info they stored in the Svpply site. I still wanted the data accessible on the web, and this turned out to be a near trivial project to write in python.

Limits: You can only upload 150 pictures a day to Tumblr. This may mean you need to break you wants.csv file into chunks of 150 lines.

See PyTumblr and Tumblr's API console for details.

import csv
import pytumblr
blogname = '<blog_name>'
client = pytumblr.TumblrRestClient(
'<consumer_key>',
'<consumer_secret>',
'<oauth_token>',
'<oauth_secret>',
)
with open('wants.csv') as data:
reader = list(csv.reader(data))
length = len(reader)
count = 0
for row in reversed(list(reader)):
response = client.create_photo('inplaceofconsumption',
state="queue",
tags=["svpply", "backup", "like"],
format="html",
caption='<a href="%s">%s</a>, %s' % (row[1], row[0], row[3]),
source=row[8])
if u'response' in response.keys() and u'errors' in response['response'].keys():
for e in response['response']['errors']:
print e
exit()
else:
count += 1
if (count % 10) == 0:
print count, "out of ", length
@danielarmengolaltayo
Copy link

did you finished the code? it would be a great solution to keep the svpply data alive!

@PsychoMg
Copy link

PsychoMg commented Sep 1, 2014

import csv
import pytumblr

blogname = '<blog_name>'

client = pytumblr.TumblrRestClient(
'<consumer_key>',
'<consumer_secret>',
'<oauth_token>',
'<oauth_secret>',
)

with open('wants.csv') as data:
reader = list(csv.reader(data))
length = len(reader)
count = 0
for row in reversed(list(reader)):
response = client.create_photo('inplaceofconsumption',
state="queue",
tags=["svpply", "backup", "like"],
format="html",
caption='%s, %s' % (row[1], row[0], row[3]),
source=row[8])
if u'response' in response.keys() and u'errors' in response['response'].keys():
for e in response['response']['errors']:
print e
exit()
else:
count += 1
if (count % 10) == 0:
print count, "out of ", length

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