public
Description: Gem for interacting with Apple's iTunes U Webservices
Home | Edit | New

Home

RTunesU is a ruby library for interacting with Apple’s iTunes U service in an object oriented manner. To use this library you will need access to your iTunes U site name, administrator credential string, and shared secret. This information should have been provided for you in an email from Apple welcoming you to iTunes U.

To work with iTunes U, you will first need to establish a connection to the webservice.


  require 'rtunesu'
  include RTunesU
  
  user = RTunesU::User.new(0, 'admin', 'Admin', 'admin@example.com')
  user.credentials = ['Administrator@urn:mace:example.edu']
  
  connection = RTunesU::Connection.new(:user => user, :site => 'example.edu', :shared_secret => 'STRINGOFTHIRTYTWOLETTERSORDIGITS')
  

Once you have a connection you can use it to find any Entity in iTunes U if you know it’s type (e.g. ‘Course’, ‘Group’) and its Handle attribute.


  course = Course.find(12345678, connection)
  #=> <RTunesU::Course:0x355854 Handle=12345678 Name='Learning in iTunes'>

This Entity will have access to all of it’s attributes and sub-entities and parent entities. You can access attributes and sub-entities with its name as a method. You can access an objets parent entity with the .parent method.

Accessing attributes:


  course.Handle

  1. 12345678
    course.Name
  2. “Learning in iTunes”
    course.Instructor
  3. “James E. Professor”

Accessing sub-entities


  course.Groups

  1. [, ]
    course.Groups.first
  2. <RTunesU::Group:0×355854 Handle=9876543 Name=’Lectures’>
    course.Groups.first.Name
  3. “Lectures”

Accessing an Entity’s parent


  course.parent


  1. course.parent.name
  2. “Learning Technologies”

For additional Information on using RTunesU see:

  • UsingUserClasses?
  • EstablishingAConnection?
  • FindingInITunes?
  • UpdatingAnEntity?
  • CreatingAnEntity?
  • DeletingAnEntity?
  • AddingSubEntities?
Last edited by mrturtle, Sat Jan 24 20:36:56 -0800 2009
Home | Edit | New
Versions: