
DI-Radio-Calendar
Source (link to git-repo or to original if based on someone elses unmodified work):
Digitally Imported Radio (www.di.fm) is my favorid internet radio station. To know what happens you need to go to the calendar side, choose your channel and choose the date. The time viewed on that side is based on the New York timezone. To calculate the local time you have to click to another side... That's not very comfortable. I wrote this theme to see what's next on di.fm.
Below the caption of di-calendar you see the actual view-section. It consists of one or more titles, that are playing at the moment. For each title you see the voting of the di-community and a "tune in"-button. If you click on the voting-value, you can jump to the di-forum and vote or read and write comments for the title. If you click on the "tune in"-button, you can listen to the actual playing title.
If you select more than one channel, the next section is the tab-section. With that tabs you can select the calendar of the cannel, you want to see.
Below the tab-section there's the calendar. Every day has it's own rectangle and may consists of one or more events. Every event has its time and the title and comment. The size of the calendar-section is dynamical. If there are more events, it's getting bigger. The days without events are not viewed. There are maximal four days viewed and the maximum search-time is 15 days (if there's no more event without a searchlimit, the calendar hangs (searching the next million years... ;-)). That means, if there's no event within the next 15 days, the calendar is empty.
Discription of the python-file:
The main thing to do is to call a "print_calendar.php"-methode with the date you want. For example, if you want to get the calendar of 01.08.2006 you call "http://www.di.fm/calendar/print_calendar.php?type=day&calendar=2&day=1&month=08&year=2006". You get a html-side containing the data of that day. All the other things to do is to parse the calendar-data out of the html-side and print it out.
After one month I've created a configuration dialog. The DI-Calendar stores the configuration in a file at "~/.superkaramba/di-radio.di-radio.conf. There's no need to rewrite the sources any more! :-). Just right klick on DI-Calendar and choose "Configure Design" and then "Konfigurieren". You see the configuration dialogs on screenshot 3. There are five pages where you can change your favorit config.
The first configuration page let you choose your favorit channels. You may chosse up to five channels for your calendar. Just select a channel within the "All channels"-list and klich the add-button. The channel will then be added to the "channels to be used"-list. If you wish to deselect one channel to be displayed you select the channel in the left list and klick the delete-button. The channel will be removed from the left list.
The channels in the left list are displayed in the order of the list. The first entry of the list is the channel that's displayed after starting DI-Calendar. If you wish to change the order, you need to select one channel in the left list and klick one of the buttons "up" or "down" to move the channel upwards or downwards in the list.
The second page is for the translation of DI-Calendar. It's not a very nice translating mechanism, I know, but it works. ;-)
The third page lets you change the location-depending settings.
On the fourth page you can change some switches to enable or disable some of the features of DI-Calendar.
On the fifth page you may enter your favorid applications for listening internet music, surfe through the internet an send mails.
05.08.2006: Release, easier change of location and language
06.08.2006: added the actual view (what's on @ the moment)
09.08.2006: fixed a problem with days with no data, added a tooltip for the title, added a comment with channel types, fixed an endless circle problem, fixed a problem with link-titles (titles are sometimes not only texts but links to other locations)
12.08.2006: fixed a problem with a changing of the calendar (date change or data change), optimized the parsing time (start and update are faster), fixed a problem with the time-calculation
24.08.2006 (0.3.0): fixed a problem with the "now playing"-view, the main calendar will now be updated every full hour, the actual view will be updated every minute (SuperKaramba does nothing while updating the data in the calendar and seems to hang in this time)
30.08.2006 (0.4.0): added "Multichannel" support, added a "tune in"-button, added a voting view
31.08.2006 (0.4.1): added threading support, fixed some minor bugs, set updating-period to 15 minutes
01.09.2006 (0.4.2): fixed a problem within a thread (a call to "redrawWidget", that sometimes results in a crash of superkaramba) PLEASE UPDATE!!, fixed a problem with the actual view (does not actualize more than one channel)
01.09.2006 (0.4.3): one more bug found and fixed (votingview was wrong), changed the titlebar
01.09.2006 (0.4.4): moderate redesign, added a feedback-line (disabled at standart)
13.09.2006 (0.5.0): fixed some errors, that may result from threading, added a configuration dialog, the calendar wold now be updated only if there are changes
14.09.2006 (0.5.1): fixed some errors with the changing of the calendar tabs and the threads
Ratings & Comments
14 Comments
by the way: which player do you guys use to listen to di.fm? amarok? do you also experience, that amarok aborts playing di.fm after a while and switches to the next stream in the playlist (usually an other di.fm server)?
Once I used xmms with the streaming-support of mpeg321. Now I use Streamripper to put the music to my archive. ;-) The reconnecting is normal. If the connection to one server is lost, the client connects to another server. The servers are listed in the pls-file. DI-Radio cuts the connection to each client after 12 hours, so there's a new connection to.
yeah... after the stream is cut, there is silence for some seconds (sometimes up to 30 secons) and then amarok chooses the next server in the playlist. but my connections to one server are usually cut anytime between 30 minutes and 2 hours and not after 12 hours... so I would like to know if this is also normal?
No, that's not normal. I often listened to DI-Radio in the past and that was sometimes more than 6 hours even if that's the free account. There may be a problem with: - the provider (some providers cut the ports with high traffic) - the hardware (networkcard) - amarok (??? I don't use that prog)
would be cool if you could add multichannel support, so that one could view the calendar for several channels. I'm often switching between chillout, lounge, progressive and vocal trance. Would nice to view them all at once...
That's a good idea, but I wonder how to get the place for all that information.
hm... maybe you could implement some vertical-tabbed interface where each channel has a tab? clicking on that tab opens the content of that channel... additional idea: can you link the 'Aktuell' (now playing) content of a channel with the di.fm pls file? e.g. http://www.di.fm/mp3/chillout.pls so clicking on the current track opens your default audio-player... :)
Thank's for your nice ideas. I will try to realize this features if I got some time... :-)
The multichannel-support is ready for testing. Hope you like it. ;-)
hey, thanks a lot. i often listen to di-radio but i never looked at their playlist. this is awesome.
I didn't know DI until now, but seeing this release I checked it out ... I guess from now on I will listen very often to it, at least its now in my bookmarks ;)
You're right, man! - The first time I listened to DI-Radio, I could'nt believe that the musik is for free and legal. The real reason to start this project: I'm so lazy calculating the New York timezone to the local time zone (bookmarks don't fix that problem)... :-)
awsome idea im a huge DI fan myself thats all i ever listen to . but i was wondering maybe you could make and aero-aio plugin for this .. that woulld be awsome