Xanga to Wordpress Exporter
xanga.r [18-May-2007] - This is a program written in rebol that parses xanga
pages to get the post and comments. Then it can output them in the wordpress rss 2.0 xml
format for wordpress to import.
In order to use it the xanga site must be in it's default theme. To do this go to 'edit theme'
in xanga and uncheck 'make this your active theme'. The bottom should have "Next 5 >>" in order
to see your older posts.
Features:
- Everything is contained within an object called 'xanga
- Retrieves all unique post urls in xanga/links
- All posts are stores with comments as objects in xanga/posts
- All posts and comment dates/times are preserved.
- You can store your posts in data form to load and export later
- Wordpress RSS 2.0 exporting
- All posts put into a "xanga" category
Limitations:
- Only retrieves first page of comments per post(25 comments)
- Has only been tested back to June 2004
- Somewhat poor error handling
- Does not get currently listening/watching/reading header items, and sometimes only gets them and misses the post.
Code Use - The code is written in rebol and so the object must be used with rebol. From the rebol console the code is below.
A basic export:
do %xanga.r
xanga/export http://www.xanga.com/user-name
xanga/export-wpxml %myfile.xml
There are also refinements on export-wpxml to specify the new wordpress site url
and to specify the title of the site.
Useful methods:
- xanga/export gets all the posts and comments from a site
- xanga/export-wpxml exports all the data to the wordpress xml format
- xanga/get-pagelist gets all of the posts on a single page
- xanga/get-post gets a single post given the page
- xanga/save-posts stores the rebol object that contains the data so you don't have to
reparse it again
- xanga/load-post loads the rebol object saved earlier
- xanga/post-data? returns true if the 'posts object has data, false if not
- xanga/clear-data resets the object and delets all stored data
xword.r [18-May-2007] - This is a gui wrapper for the xanga.r script. In order to
run the script you must have the xanga.r script and the latest version of
rebgui.r.
I am also providing a windows and a linux binary version if you don't want to run the script.
Usage:
- Type in correct site url
- Click "Get Data" and wait until finished
- To export the wordpress file: type in a file name and click "Export"
- To save data for the future click the "Config" tab and click "Save"
- You can also view the posts in the "Posts" tab
Importing to Wordpress:
- Select Import from wordpress
- Select file and click import
- Select the user you want to map the posts to
File | Type | Description | Version Date | Dependencies |
xanga_1.r | Rebol script |
Object for saving xanga posts | August 24, 2007 | rebol core or view |
xanga_2.r | Rebol script |
Revision 2 of xanga.r | January 2, 2009 | rebol core or view |
xanga_3.r | Rebol script |
Revision 3 | April 22, 2009 | rebol core or view |
xanga.r | Rebol script |
Latest version of xanga.r | Sept. 18, 2009 | rebol core or view |
xword.r | Rebol script |
GUI for xanga.r | August 24, 2007 | rebol view,
Rebgui, xanga.r |
xword.exe | Binary Executable |
Program for saving xanga posts to wordpress | August 24, 2007 | Windows |
xword | Binary Executable |
Program for saving xanga posts to wordpress | May 19, 2007 | Linux, X11 |
Version History:
- May 18, 2007 - Original version posted
- May 19, 2007 - Small bug fix
- August 24, 2007 - Fix bug in comments, changed format for saving posts.r file and reading. Not compatible with older versions. Can change update file by running rebol script below updates.
rebol[]
posts: reduce load %posts.r
foreach post posts[post/comments: reduce post/comments]
save/all %posts.r posts
- January 2, 2009 - Some formatting changes have happened on xanga, so I'm leaving the original and adding the new in case these changes aren't universal. The xword program only uses the old version though.
- April 22, 2009 - Xanga changed their url scheme which messed up all the links in the script. This has been corrected in the latest xanga.r file.
- September 18, 2009 - Xanga is now attaching the comment id number in the div tag. This version is simply has one line commented out.
;[thru <div class="ctext snap_preview"> | thru <div class="ctext">]