Project

maxml

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
MaxML is a utility that helps you to download and save XML documents straight to MongoDB.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
~> 1.6.3.1
~> 2.4.0
 Project Readme

MaxML

Download, parse and save an XML document to MongoDB

Install

Make sure you're using Bundler.

Add gem "maxml" to your Gemfile.

As your project may depend on a particular version of the mongo and/or bson_ext gem, you need to add those to your Gemfile as well.

gem 'maxml'
gem 'mongo'
gem 'bson_ext' 

Usage Example

# DB defaults to "localhost" for `host` and 27017 for `port`
db_config = {database: "maxml_test", collection: "xmls"}
reddit = MaxML::XML.new("http://www.reddit.com/.rss", db_config)

# Parse the XML into a JSON string
reddit.to_json

# Parse the XML into a Ruby hash
reddit.to_hash

# Return the serialized XML string
reddit.to_s

# Save to DB
reddit.save

Copyright and License

Copyright © 2014 David Leung

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.