It's nice when the server and the client talk, but it is more nice when the servers talk to each other.
Since I did not come upon any python code of implementing that , here is a python snippet to get icecast2 stats. This function gets stats of an icecast2 mount source you want to track. In my case all I wanted was the listeners number. So i am calling it like self.getIcecastStats("/playlist",['listeners']). It returns a dictionary . In my case it will be like : {'listeners':2}.
..Oh I forgot. This functionality is now part of kaotonik since if you are logged in you can view in the start page , how many are listening to radio right now.
Handle with care , as you see there is no exception handling .
Since I did not come upon any python code of implementing that , here is a python snippet to get icecast2 stats. This function gets stats of an icecast2 mount source you want to track. In my case all I wanted was the listeners number. So i am calling it like self.getIcecastStats("/playlist",['listeners']). It returns a dictionary . In my case it will be like : {'listeners':2}.
..Oh I forgot. This functionality is now part of kaotonik since if you are logged in you can view in the start page , how many are listening to radio right now.
Handle with care , as you see there is no exception handling .
def getIcecastStats(self,source_mount, keys):
"""gets icecast2 stats of the specified source_mount. For this source
it will return the keys values in a dict."""
import urllib2
password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
# create a password manager
# Add the username and password.
# If we knew the realm, we could use it instead of ``None``.
top_level_url = "http://127.0.0.1:8000"
username="admin"
password="password"
password_mgr.add_password(None, top_level_url, username, password)
handler = urllib2.HTTPBasicAuthHandler(password_mgr)
# create "opener" (OpenerDirector instance)
opener = urllib2.build_opener(handler)
# use the opener to fetch a URL
f=opener.open(top_level_url + "/admin/stats.xml")
xmls=f.read()
from xml.dom import minidom
domObj = minidom.parseString(xmls)
nodes = domObj.getElementsByTagName('source')
retD={}
for nod in nodes:
if nod.getAttribute('mount') == source_mount:
for key in keys:
vnodes = nod.getElementsByTagName(key)
if vnodes:
retD[key]=vnodes[0].firstChild.nodeValue
break
return retD
thk Τετ. 28 Ιαν. 2009 13:28
0 views
Svn is givin me hell again. It seems i am gonna be very poor because there is no time to work.I spend all my time trying to solve svn issues. Svn merge is like hell.You have to look at the logs (with svn log) of the files you want to merge and decide which is the right revision to chooose. Last night I accidentally merged with a past revision and .. hell came.
If you d like to undo the last merge, then your best bet is to delete all directories that were merged and do a fresh svn update to get the latest revision in your working copy. This of course means that you often commit back to your repo, and you have a recently updated revision there.
Today , svn remembered that it had problems with a greek filename that was added many months ago..
The solution was :
export LC_CTYPE=el_GR.UTF-8
and then svn update or svn commit.
Too much time spent to maintain the code and not writing the code.
I 'd like sometime to try GIT but I do not know how well it intergrates with the other daemon..eclipse..
And by the way:
Today I felt lucky because of running Linux. Next to mine pc had a virus and a friend called with virus problems too.
Sometimes i consider windows impossible to be operated by the average user.
If you d like to undo the last merge, then your best bet is to delete all directories that were merged and do a fresh svn update to get the latest revision in your working copy. This of course means that you often commit back to your repo, and you have a recently updated revision there.
Today , svn remembered that it had problems with a greek filename that was added many months ago..
The solution was :
export LC_CTYPE=el_GR.UTF-8
and then svn update or svn commit.
Too much time spent to maintain the code and not writing the code.
I 'd like sometime to try GIT but I do not know how well it intergrates with the other daemon..eclipse..
And by the way:
Today I felt lucky because of running Linux. Next to mine pc had a virus and a friend called with virus problems too.
Sometimes i consider windows impossible to be operated by the average user.
thk Πεμ. 22 Ιαν. 2009 19:43
0 views
καιρο έχω να γραψω κανα αρθράκι ας γραψω μια ασχετη καοτονοτικη σκέψη που μου ρχεται στο μυαλό. Τη τελευταία εβδομάδα εχει ζεσταθεί το καοτονικ με το ράδιο live και testing. Μπορείτε να ακούτε απο εδώ -- > http://www.kaotonik.net:8000/playlist.m3u και αν είσαστε εγγεγραμμένος χρήστης να μπείτε στο studio εδώ --> http://www.kaotonik.net/en/radio .Αν δεν εισαστε μπορείτε να το διορθώσετε άμεσα εδώ --> http://www.kaotonik.net/el/users/join .
Που λέτε ολα στη ζωη ειναι μια αντιγραφή. Καθε τι που κανουμε αντιγράφει πράγματα που εμείς θεωρούμε ωραία. Δεν θα υπήρχε τίποτα χωρις αντιγραφή ανακάτεμα φαντασια και ανασύνθεση γι αυτό και γαμιούνται οι πατέντες που λένε και οι λινουξάδες.
Η αγαπημένη μου εφαρμογή για να ακούω μουσική είναι το amarok. Να φανταστείτε είναι τοσο ωραιο (σχετικά ειναι όλα), που τις προάλλες πηγα να παιξω μουσική στο winamp , μου την έσπασε , και έκανα rebοot σε λινουξ για να τρέξω το αγαπημένο amarok.
Οσοι ενδιαφέρονται περί τι OS τρέχει ο κόσμος ας καταλάβουν πως αυτο που κρατάει το κόσμο σε ενα λειτουργικό σύστημα , είναι οι εφαρμογές που τρέχει σε αυτό.
Μια μπύρα στα κοπέλια που γράφονε το amarok .
Και τζαμπα .
Και το κυριότερο , open source.
A , τo robotaki βαζει τη καλύτερη μουσική.
Που λέτε ολα στη ζωη ειναι μια αντιγραφή. Καθε τι που κανουμε αντιγράφει πράγματα που εμείς θεωρούμε ωραία. Δεν θα υπήρχε τίποτα χωρις αντιγραφή ανακάτεμα φαντασια και ανασύνθεση γι αυτό και γαμιούνται οι πατέντες που λένε και οι λινουξάδες.
Η αγαπημένη μου εφαρμογή για να ακούω μουσική είναι το amarok. Να φανταστείτε είναι τοσο ωραιο (σχετικά ειναι όλα), που τις προάλλες πηγα να παιξω μουσική στο winamp , μου την έσπασε , και έκανα rebοot σε λινουξ για να τρέξω το αγαπημένο amarok.
Οσοι ενδιαφέρονται περί τι OS τρέχει ο κόσμος ας καταλάβουν πως αυτο που κρατάει το κόσμο σε ενα λειτουργικό σύστημα , είναι οι εφαρμογές που τρέχει σε αυτό.
Μια μπύρα στα κοπέλια που γράφονε το amarok .
Και τζαμπα .
Και το κυριότερο , open source.
A , τo robotaki βαζει τη καλύτερη μουσική.
To radiο ανέβηκε , αυτη τη στιγμη μεταδιδουμε live απο εδώ http://www.kaotonik.net:8000/playlist.m3u ( τη στιγμη που το διαβάζετε βέβαια μπορει και οχι).
Ειναι σε extra beta φάση και θα αλλάξω καποια πραματα μαλλον και σημερα οσον αφορα downstreaming των mp3 που ανεβάζετε.
το Βραδυ απο δω και πέρα, θα είναι online and testing.
Δεν ειναι οποιο και οποιο ραδιο , ειναι μια νέα εφαρμογή.
Μπειτε στο chat http://www.kaotonik.net/achat/ για περαιτερω πληροφορίες .
Οι χρησται του καοτονικ να μπουν σιγα σιγα στο studio -- > http://www.kaotonik.net/en/radio
Ειναι σε extra beta φάση και θα αλλάξω καποια πραματα μαλλον και σημερα οσον αφορα downstreaming των mp3 που ανεβάζετε.
το Βραδυ απο δω και πέρα, θα είναι online and testing.
Δεν ειναι οποιο και οποιο ραδιο , ειναι μια νέα εφαρμογή.
Μπειτε στο chat http://www.kaotonik.net/achat/ για περαιτερω πληροφορίες .
Οι χρησται του καοτονικ να μπουν σιγα σιγα στο studio -- > http://www.kaotonik.net/en/radio
από cHARaKter 2009-01-17 20:55
Kaloriziko maaaaaaaaan!!!!
από thk 2009-01-18 21:44
ειμαστε online και testing τωρα κυριακή 18/01 βράδυ .Μπειτε στο chat για info.