Like the title of this entry implies, this Python script will scrape an entire Xanga feed and convert it into MovableType's input format. The intended audience for this script is people who are on Xanga, but either have or are in the process of moving over to MovableType.
I don't actually fall into the intended audience of this script, which makes it strange that I would write it, but I do have good motivations:
1) I needed to learn Python for work
2) I needed to learn regular expressions for work
3) I am going to reused this code to add in some new features to the feed aggregator so that it can display comments
4) MovableType is my uber tool, and everyone should be free to use it without cell phone number portability issues :)
I've only tested this on two Xanga accounts. If you have a really weird Xanga modifications, then this will most likely break. Version 0.1 contains one or two bugs, so the program will report ~2 errors when it's done. If there's interest, I'll put out a version 0.2 that fixes these bugs, plus any others that people find.
BTW - while I was injured I also taught myself a bit of Perl over the break, and then decided that learning Python and Perl at the same time was a really, really, bad idea.
So, without further adieu:
xanga2mt release 0.3
Update: upgraded to version 0.2, which fixes bugs with comment scraping
Update: upgraded to version 0.3, which contains a small fix to make the script compatible with more sites





Comments (15)
Im a friend of a friend! i dont have python either =(
Posted by alejandra | February 12, 2004 10:08 AM
Posted on February 12, 2004 10:08
Hi Kenneth,
I've just tried to use xanga2mt.py to convert my Xanga site to a Movable Type import file -- but it's returning the following:
opening xanga url http://www.xanga.com/home.aspx?user=davka
ERROR: could not find entries (1)
ERROR: could not find entries (2)
SCRAPE FAILED!
Xanga2MT Statistics:
0 entries
2 errors
Any chance you could try running it from your end? I'm sure I'm a friend of a friend of a friend of a friend...
Cheers,
Brad.
Posted by Brad Weslake | March 13, 2004 4:14 AM
Posted on March 13, 2004 04:14
Brad,
Thanks for giving the tool a try. I'll try and debug this tomorrow.
- Ken
Posted by kwc | March 14, 2004 10:14 PM
Posted on March 14, 2004 22:14
Brad,
I believe I've fixed the problem. The fixed script found 198 entries on your site. Let me know if this is correct. If you still have trouble running from you end, I can post the result for you.
Good luck converting to Movable Type,
Ken
Posted by kwc | March 14, 2004 11:16 PM
Posted on March 14, 2004 23:16
Ken,
Brilliant, I was able to run version 0.3 no problems -- thanks so much for responding, that would have taken me hours to do by hand, obviously. One discrepency though -- when I ran it, it only turned up 191 entries (not the 198 you said it detected when run on your end). If you kept the file you retrieved, could you send it on?
Plenty of good karma accruing your way.
Brad.
Posted by Brad Weslake | March 20, 2004 8:15 PM
Posted on March 20, 2004 20:15
I just stumbled upon your weblog. Does this new tool also enable moving Xanga entries to Typepad?
Posted by jenni | May 1, 2004 8:48 AM
Posted on May 1, 2004 08:48
Yes, it should allow you to move xanga to typepad.
Posted by kwc | May 1, 2004 11:30 AM
Posted on May 1, 2004 11:30
thanks... but I have no idea what Python is or what to do with it. (Should I?)
Posted by jenni | May 2, 2004 7:42 PM
Posted on May 2, 2004 19:42
Jenni,
Give me the name of your Xanga account and I will do the conversion for you.
Posted by kwc | May 2, 2004 9:06 PM
Posted on May 2, 2004 21:06
Hey man,
I've been searching all over the internet to find a way to convert my xanga page into movable type... so far xanga2mt seems like the only way to do it. I tried DL'ing python and running it but I honestly have no idea how to. would you mind running it over on your end? usr = singidunum381
thanks,
pavle
Posted by pavle | June 4, 2004 10:38 AM
Posted on June 4, 2004 10:38
Pavle, if you can wait several days I'll run it for you. I'm currently out of the country on vacation.
Posted by kwc | June 4, 2004 12:45 PM
Posted on June 4, 2004 12:45
Hey boss. Also tried to download python and run for my std xanga site. This was the output and I did not see anything as far as a .txt file. I'm not the greatest on computers. Any chance I'm a friend of a friend...usr=compleatang.
Thanks.
C
>>> ================================ RESTART ================================
>>>
Usage:
xanga2mt [xangausername]
Traceback (most recent call last):
File "C:\Python24\xanga2mt.py", line 474, in -toplevel-
sys.exit()
SystemExit
>>>
Posted by Casey | August 5, 2005 1:49 AM
Posted on August 5, 2005 01:49
Hey boss. Also tried to download python and run for my std xanga site. This was the output and I did not see anything as far as a .txt file. I'm not the greatest on computers. Any chance I'm a friend of a friend...usr=compleatang.
Thanks.
C
>>> ================================ RESTART ================================
>>>
Usage:
xanga2mt [xangausername]
Traceback (most recent call last):
File "C:\Python24\xanga2mt.py", line 474, in -toplevel-
sys.exit()
SystemExit
>>>
Posted by Casey | August 5, 2005 1:50 AM
Posted on August 5, 2005 01:50
Hi, Is there was any way to get this program to copy protected posts from xanga as well
Posted by Allen | August 8, 2005 9:02 PM
Posted on August 8, 2005 21:02
Hello
I want to move form xanga to movabletype with all the old posts.
I search in the internet and found that you have written a script, xanga2mt. Which can help me to complete the task. However I know nothing about python, I tried to install python and run the script. A black window appear and then disappear immediately. No xxx.txt is formed.
Could you teach me how to use the xanga2mt or help me to get the achieves?
My xanga id is : lammh
Thanks a lot,
Freddy
Posted by Freddy | November 10, 2005 8:39 AM
Posted on November 10, 2005 08:39