0.0
No commit activity in last 3 years
No release in over 3 years
A fast and simple iTunes XML parser based on nokogiri-plist
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 5.8
~> 0.10
~> 10.0

Runtime

 Project Readme

ItunesParser

Dependency Status Code Climate

A simple and fast iTunes Library XML parser based on nokogiri-plist.

Description

The iTunes Library XML is a PList file, so logically, the best way to parse this is with a PList parser.

The main concept is to keep things simple, using Arrays and Hashes, so you can later use the items within the XML file as you please.

Dependencies:

  • Ruby >= 2.0.0
  • Nokogiri-plist ~> 0.5

Installation

Add this line to your application's Gemfile:

gem 'itunes_parser'

And then execute:

$ bundle

Or install it yourself as:

$ gem install itunes_parser

Usage

First, create a new instance:

ip = ItunesParser.new(file: "/route/to/the/file.xml")

Then you can:

  • Check all the playlists:

      ip.playlists
    
  • Or get them with just the ID and Name:

      ip.playlists(pretty: true)
    
  • And then show a playlist tracks based on the ID:

      a.playlist_tracks(id: <playlist_id>)
    
  • Or check all the tracks:

      a.tracks
    
  • Of course you can also get just the ID and Name:

      a.tracks(pretty: true)
    
  • And check just one track based on the ID:

      a.track(id: <track_id>)
    

Author

Copyright (c)

Development

You can use the example XML in the examples folder and check it in the console running bin/console.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/rojosinalma/itunes_parser. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

This library is distributed under the UNLICENSE license. Please see the LICENSE file.