jpadilla / tumblr-to-ghost Goto Github PK
View Code? Open in Web Editor NEWTumblr exporter to Ghost importer
Home Page: https://tumblr-to-ghost.herokuapp.com
License: MIT License
Tumblr exporter to Ghost importer
Home Page: https://tumblr-to-ghost.herokuapp.com
License: MIT License
The export created has a list of posts and tags, but no relation between them, so although the posts and tags get imported into Ghost, none of the posts actually have any tags associated with them.
When the tumblr post has multiple posts with title "abc" the export files will generate the same amount of posts - unfortunately do all have the same slug. Ghost will refuse to import *.json files wich contain multiple posts with an identical slug.
Quick fix:
In line 116 assign e.g. the timestamp:
[...]
'title': title,
'slug': slug + str(timestamp),
'markdown': body,
'html': body,
[...]
Better fix:
a) Create the first slug as before. Increment every next slug.
#1 Post title = "Hello"
slug = "Hello"
#1 Post title = "Hello"
slug = "Hello-2"
#1 Post title = "Hello"
slug = "Hello-3"
[...]
b) Create the first slug as before. Add timestamp to every next slug.
#1 Post title = "Hello"
slug = "Hello"
#1 Post title = "Hello"
slug = "Hello-2015-05-01"
#1 Post title = "Hello"
slug = "Hello-2015-05-04"
[...]
The decision is up to you @jpadilla :)
I'm running the project locally after getting an error on the heroku app, I found that self.get_blog_info()
can be causing the error because Tumblr is not authorizing the API call, this is the response {u'meta': {u'status': 401, u'msg': u'Not Authorized'}, u'response': []}
When running this on OS X Mavericks I cannot convert tumblr to ghosts. I only get this stacktrace stating "No such file or directory.":
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/Users/MyPC/Desktop/tg/web.py", line 22, in index
posts = tumblr_to_ghost.get_posts()
File "/Users/MyPC/Desktop/tg/tumblr_to_ghost.py", line 70, in get_posts
return self.create_ghost_export(posts)
File "/Users/MyPC/Desktop/tg/tumblr_to_ghost.py", line 92, in create_ghost_export
"markdown": doc.markdown,
File "/Users/MyPC/Desktop/tg/src/pyandoc-master/pandoc/core.py", line 65, in <lambda>
(lambda x, fmt=fmt: cls._output(x, fmt)), # fget
File "/Users/MyPC/Desktop/tg/src/pyandoc-master/pandoc/core.py", line 82, in _output
stdout=subprocess.PIPE
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 709, in __init__
errread, errwrite)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1326, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
This helps tremendously!
I'm working on getting http://samuelgoodwin.tumblr.com off tumblr and onto ghost and your tool is exactly what I needed. Thank you!
Maybe do a check somewhere? I can't import mines because of this ๐ข
I'm trying to run blog.benbowler.com though the export but I'm getting an Internal Server Error.
Not sure how it happens but it happened to me.
Great tool, but it has a couple of issues with text import:
I've also noticed that if I tried to import my blog using the my own domain address it failed, but if I imported it as my_blog_name.tumblr.com it worked just fine. Might be similar reason why a number of people said they couldn't export their blog.
Thanks for all your hard work. (And if I had better working knowledge of python I would've rolled my sleeves up already and posted the code that would sort out the two issues I've found.)
Scenario:
Tumblr entry #1 has tags:
#a, #b, #c
Tumblr entry #2 has tags:
#a, #b, #d
After exporting posts are created with following tags:
Ghost post #1 has tags:
#c
Ghost post #2 has tags:
#a, #b, #d
=> Every tag is only assgined to a single post.
This leads to following tag overview:
This is how this certain overview should look like (with a correct tag assignment):
Should do some kind of check for duplicates before adding the item to the array.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.