1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

C'mon, make it easy on the user!

Discussion in 'Daily Tunes Site Discussion and Feedback' started by weefle, Nov 14, 2003.

  1. macrumors newbie

    #1
    I was shocked and dismayed that submitters are asked to retype all the artist, track, and album information, when it must be obtainable given just the iTunes Music Store URL.

    I've written a very quick and dirty PHP script that, given an iTunes Music Store URL (of the http:// type that you can copy out of iTunes, or of the itms:// variety that iTunes actually handles itself), will return all the track information for that particular song. Note, you have to enter an iTunes Music Store URL for a track-- I don't think this will work with a URL for an album, artist, or anything else (although I haven't tried).

    The interface:
    http://ambrose.mcs.muohio.edu/itmsp/

    And the source:
    http://ambrose.mcs.muohio.edu/itmsp/index.phps

    Please feel free to copy any or all of this horrible code to make dailytunes.com work the way it should.

    weefle
     
  2. arn
    macrumors god

    arn

    Staff Member

    #2
    strong work.

    will get on it...
    arn
     
  3. macrumors newbie

    #3
    Heh, well, slop work, really-- just a four-hour hack-- but thanks. I sincerely hope it'll improve the site and make it easier for folks to contribute.
     
  4. arn
    macrumors god

    arn

    Staff Member

    #4
  5. arn
    macrumors god

    arn

    Staff Member

    #5
    made the following changes...

    lemme know if you think this will cause problems in other places:

    Code:
    function start_element($parser, $name, $attribs) {  
        global $current_element, $in_track_list, $done,$current_data;
      
      if ( ! strcasecmp($name, 'tracklist') ) { $in_track_list++; }
     
      if ( $done || !$in_track_list ) { return; }
     
      $current_element = $name;
      [b]$current_data="";[/b]
    }
    
    function character_data($parser, $data) {
        global $current_data, $end_of_songs, $done, $in_track_list;
      
      if ( $done || ! $in_track_list) { return; }
        
        [b]$current_data .= html_entity_decode($data); [/b]
    }
    
     
  6. macrumors newbie

    #6

    Yeah, darn it, I knew there was a reason why I hadn't posted this yet (I haven't touched this in a week). I noticed that same thing on a Norah Jones track. I couldn't figure out what the problem was. A friend suggested something about decoding HTML entities, but if you look at what's in the parsed XML, it's missing everything before the quote. I blame expat.

    If you have the DOM-based parser installed, I think I can give you code that'll parse up the XML DOM-style-- maybe the DOM parser will be smarter about quotes.
     
  7. arn
    macrumors god

    arn

    Staff Member

    #7
  8. macrumors newbie

    #8
    Rock! Worked great for Dido!

    Thanks for the incredibly quick work, and I'm really glad to see that you got the quotes fixed so easily.

    Thanks again.

    weefle
     
  9. Administrator emeritus

    Mudbug

    #9
    thanks weefle & arn -

    my job just got easier :)
    works great!
     
  10. macrumors regular

    mike3k

    #10
    It's awesome! I love it - it's so much easier to submit songs now!
     
  11. macrumors newbie

    #11
    No prob. I'm guessing that it's probably a lot easier on editors this way, too.

    I'm super-glad to be of help.
     
  12. macrumors 6502a

    Jetson

    #12
    Great Work Guys!

    Happy to see DailyTunes making it easier on the user by automatically copying the album info from iTunes!

    Kudos to weefle & arn.

    Just one thing - Apple frequently mislabels the genre. I would like to be able to place the *correct* genre on my recommendation. I don't think it would cause ANY confusion for DailyTunes users (several others have also commented on Apple's rather lame cataloging efforts). Also the songs would be placed into the correct DailyTunes genre category.

    My requests to have have the genre changed on a few songs have gotten no response so far.
     
  13. macrumors 6502a

    #13
    wow, that was fast.

    p.s. it really irritates me that every Eric Clapton song is called rock when clearly he is a blues guitarist. But then I'm a fanatic.
     
  14. Administrator emeritus

    Mudbug

    #14
    Re: Great Work Guys!

    I don't think I've seen any "genre change" requests so far, unless you've done it by PM's to arn... Anyway - I see both sides of this arguement. I tend to agree with you - since we're compiling our own list, it should be the genre deemed most suitable by the listeners, not by Apple. If you know of some, by all means, send the error requests, or PM or IM me and I'll take care of it. :)

    and a little FYI about the cataloging by Apple - as I understand it, Apple is just adding the already encoded songs/albums to the catalog, not ripping the songs themselves, so the genre of the piece is probably set by either the artist, or the label, and not by Apple. I also think the songs are genre'd by album, and not by individual track, so if that's the case, a rock track on a gospel album (just for example) would still get a "gospel" genre listing, even though it's clearly rock.
     

Share This Page