adammorris / luis-rei-wordpress-to-evernote Goto Github PK
View Code? Open in Web Editor NEWHome Page: http://luisrei.com/2008/03/24/out-of-wordpresscom-and-into-evernotecom
Home Page: http://luisrei.com/2008/03/24/out-of-wordpresscom-and-into-evernotecom
This script is a branch from Luis Rei's wordpress.py http://luisrei.com/2008/03/24/out-of-wordpresscom-and-into-evernotecom It will convert a wordpress export into a file that can be imported into Evernote. This branch adds a feature to create a single evernote import file (instead of multiple html files). Note tags are made up of both categories and tags. Haven't tested without the -c option. Usage: python wordpress.py [-hac] [-o outdir] infile Converts a WordPress Export File to multiple html files. Options: -h,--help Displays this information. -y,--create separte files by year -c,--categories Create directory structure from post categories. -o,--outdir Specify a directory for the output. Example: python wordpress.py -y -c -o ~/TEMP ~/wordpress.2008-03-20.xml ## utf-8编码 最终解决方法-> http://www.crifan.com/python_urllib_unquote_messy_issue/
I got several hundred errors when I first synced my imported notes, and it appears most if not all of the affected posts had punctuation in the title, such as a period or quotes. I'm sure you're busy with other stuff, but I wanted to let you know. Maybe I'll figure out how to fix it (regex?).
I used this today to convert some old blog posts for use in Evernote. The WordPress blog only had about 65 posts. Once I brought them into Evernote about 11 of them had no content in the note though, but the title and date were set properly. I can't see any common trait that would tie them together.
Regardless, it sure was a time saver for me. Thanks for sharing!
--Nathan Wolek
D/Luis-Rei-Wordpress-to-Evernote $ python wordpress.py -y ~/Downloads/danielsieradski.wordpress.2017-06-12.xml
Traceback (most recent call last):
File "wordpress.py", line 177, in <module>
main(sys.argv)
File "wordpress.py", line 175, in main
convert(infile, outdir, splitByYear, categories)
File "wordpress.py", line 47, in convert
dom = minidom.parse(infile)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
return expatbuilder.parse(file)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/dom/expatbuilder.py", line 924, in parse
result = builder.parseFile(fp)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/dom/expatbuilder.py", line 207, in parseFile
parser.Parse(buffer, 0)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 443195, column 295
D/Luis-Rei-Wordpress-to-Evernote $ python wordpress.py ~/Downloads/danielsieradski.wordpress.2017-06-12.xml 1 15s 79ms
Traceback (most recent call last):
File "wordpress.py", line 177, in <module>
main(sys.argv)
File "wordpress.py", line 175, in main
convert(infile, outdir, splitByYear, categories)
File "wordpress.py", line 47, in convert
dom = minidom.parse(infile)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
return expatbuilder.parse(file)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/dom/expatbuilder.py", line 924, in parse
result = builder.parseFile(fp)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/dom/expatbuilder.py", line 207, in parseFile
parser.Parse(buffer, 0)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 443195, column 295
First of all thanks for sharing your script Wordpress-to-Evernote script. It ran successfully with a large export from WordPress and load it in my local evernote instance (windows).
Unfortunately, most of the notes converted do not synchronize for many reasons:
Hi, I tried running this script to migrate my posts from Wordpress to Evernote, but it stops with an error.
This is the full output:
C:\Python27>python wordpress.py -o c:\python27\ .\isegrimm24-2.xml
Traceback (most recent call last):
File "wordpress.py", line 166, in
main(sys.argv)
File "wordpress.py", line 164, in main
convert(infile, outdir, splitByYear, categories)
File "wordpress.py", line 49, in convert
post["title"] = node.getElementsByTagName('title')[0].firstChild.data
AttributeError: 'NoneType' object has no attribute 'data'
Any idea what the issue could be? I tried altering the syntax in line 49, but it always returns this error.
To get this far I had to add the following to the rss-section of the exported xml:
xmlns:atom="http://www.w3.org/2005/Atom"
Otherwise the script would give this error:
xml.parsers.expat.ExpatError: unbound prefix: line 48, column 1
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.