Skip to content

thomasfl/wordpress_import

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

WXR / WordPress eXtended RSSfile import

A parser for Wordpress export files for Ruby. Uses Nokogiri to parse XML. Removes junk caused by users pasting content from MS Word. Usage:

require 'wordpress_import'

content = ""
open("sample_wordpress.xml") do |s| content = s.read end

WordPress.parse(content) do | article |
  puts "----"
  puts "Title: " + article.title
  puts article.body
  puts
  puts "Comments:"
  article.comments.each do |comment|
    puts "  Author: " + comment.author
    puts "  " + comment.content
    puts
  end
  puts "Tags: " + article.tags.join(", ")

end

Written by Thomas Flemming

About

WordPress eXtended RSSfile (wxr files) parser for Ruby.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published