Giter Club home page Giter Club logo

luis-rei-wordpress-to-evernote's Introduction

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/

luis-rei-wordpress-to-evernote's People

Contributors

adammorris avatar johnnychq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

suofiya johnnychq

luis-rei-wordpress-to-evernote's Issues

Periods in post title cause invalid note content

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?).

usage report

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

python errors

 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

Notes doesn't synchronized after conversion

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:

  • flagged as unsyncable (0x4) Attribute "class" must be declared for element type "a"
  • flagged as unsyncable (0x4) The entity name must immediately follow the '&' in the entity reference. (ENML_VALIDATION)
  • flagged as unsyncable (0x4) Element type "description" must be declared. (ENML_VALIDATION)
  • flagged as unsyncable (0x4) Attribute "class" must be declared for element type "span". (ENML_VALIDATION)

'NoneType' object has no attribute 'data'

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.