Paid affiliate advertisement
Need Help in creating custom modules (auto node creation from xml feed, etc)
I have a music database system in place that creates 3 xml files. The fields from these xml files need to be created as nodes (song node, album node, and artist node) and have appropriate child/parent relationships between them. An artist has many albums has many songs. An artist can also have songs with no albums. The files are:
nowPlaying.xml
------------------
Shows info from the currently playing track in real time. Important fields in this file are songID, playCount, RequestCount among other fields. This file is refreshed every song change which can be anywhere from 1 to 7 minutes depending on song duration.
musicAdded.xml
------------------
This file shows info for the last 100 songs that were added to the database. Important fields are songID, songTitle, artist, album, genre, mood, bpm (beats per minute) among other fields. Each song element appears in the file by date_added in descending order....The most recent song is added to the top.
songdb.csv
------------------
This file contains the entire music database of over 6000 songs along with info from their respective albums and artist. This file will need to be loaded first to "set up" the site. The other two files (nowPlaying.xml and musicAdded.xml) will routinely be checked for changes on a maintenance basis. This mysql database table can be exported into any file. CSV might be easier to work with in importing the data but it can be whatever works the best.
I tried using the noderef create module (http://www.darrenmothersele.com/drupal-blog/node-reference-create-drupal...) to create the relationships between the child node (song) and the parent nodes (album, and artist) but it wouldn't create the relationships as the nodes were being imported. The node import module imported the entire music database table (songdb.csv) into song nodes but it didn't create the parent nodes and wouldn't work with node references.
I need help in creating custom modules that will do the following:
====================================================
1. Import entire music table
---------------------------------
Import the entire song table into child nodes (song) and create their associated parent nodes (from the album and artist fields) if they don't exist and establish the artist/album/song relationship between them. If parent nodes do exist, associate the child (song) with the parent nodes (album and/or artist.... some songs might not have an album node so associate them to the artist). This involves creating parent nodes from child nodes and creating relationships. Also, take the genre, bpm, and mood fields from the songdb.csv file and add taxonomy terms for them. This is a one-time use module and should only be used at system setup time... or if i need to restore the entire drupal site for some reason.
2. Display NowPlaying Song Node
---------------------------------
Custom code (in a block) that will check the nowplaying.xml file every so often (say 60 seconds), check for the songID in that xml file. If the songID is the same, do nothing...wait 60 seconds. If the songID from nowplaying.xml has changed, display the song node for that songID and copy the date_played and performance fields from the xml file into the song node.
The song node will have song, artist, album info as well as album art and website links (coming from database file during system setup.... Item #1). I saw a block refresh module that would work really well with this (http://drupal.org/node/255745).
3. Create nodes from xml file
------------------------------
A custom module that will check the musicAdded.xml file. If there are no changes, do nothing. If there are changes, check the file for songIDs that do not exist in drupal and add the associated nodes, relationships, and taxonomy terms for each. This code should run once a day... Preferrably at 3am or so.
Given our bugetary restrictions, I can only afford $100 - $150 for such a project. Should this amount be unsuitable for the entire project OR the project needs to be scaled down to fit within our budget, please let me know what it would take to get something like this done.
I would appreciate all feedback. You can contact me via my contact form.
Thanks,
Elliott
