Python Community Server: Development (20021111T15:37:21)

UserTalk to Python. Dave Winer:

Yesterday I wrote a very simple suite in Frontier called aggyBaby, that uses the new aggregator XML-RPC interface to build a very bare-bones but super-fast static page of the latest stories from the channels I've subscribed to. I think I'll release the UserTalk code in the hope that someone will convert it to Python and/or Java.
Sounds like fun. I'll do Python!

Progress here. Stay tuned. Right now I'm getting an XML parse error when I call getRecentItems:

D:\Program Files\Radio UserLand\www\gems>aggyBaby.py
Enter your login name: phil
Enter your password:
Traceback (most recent call last):
File "D:\Program Files\Radio UserLand\www\gems\aggyBaby.py", line 110, in ?
main()
File "D:\Program Files\Radio UserLand\www\gems\aggyBaby.py", line 53, in main
newitems = aggregator.getRecentItems( data.login, data.password, data.lastScanInfo['ctNewItems'] )
File "d:\lib\python22\lib\xmlrpclib.py", line 821, in __call__
return self.__send(self.__name, args)
File "d:\lib\python22\lib\xmlrpclib.py", line 975, in __request
verbose=self.__verbose
File "d:\lib\python22\lib\xmlrpclib.py", line 853, in request
return self.parse_response(h.getfile())
File "d:\lib\python22\lib\xmlrpclib.py", line 891, in parse_response
p.feed(response)
File "d:\lib\python22\lib\xmlrpclib.py", line 390, in feed
self._parser.Parse(data, 0)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 204, column 25

Comment

Where the passwords and prefs are stored in Radio (a walkthrough).

Most of the time, if you want to find the code for something in the Radio web interface, you open the Radio console, hit Ctrl-J, type radio.html, hit enter, and pick the most likely sounding function.


However, the prefs are different.  What are prefs, you ask?  These.  All the config for your blog.  They're a little trickier, because there's a bit of architecture in there to make changing the text easier than it would be if they were all individual HTML-generating functions (and to make building the prefs system much easier).


Open the C:\\Program Files\\Radio UserLand\\www\\system\\pages\\prefs.txt file.  It's calling radio.prefs.browseSystemPrefs().  Aha!


So: back to the console, hit Ctrl-J, type radio.prefs, hit enter.  Look down a little to the bit where it talks about radio.data.localization.languages.  That's where the prefs are.


Now: Ctrl-J, radio.data.localization.languages, enter.  Expand english, then outlines, and open prefs.  There you have it: all the prefs.


The reason I'm going through this is that I'm trying to figure out where passwords are stored, so I can tell someone how to recover her password.  Here's the password page.  Look at the URL: pref number 6.2.  I guess that means pref number 2 in block number 6 ("Advanced").


Well, there it is: radio.prefs.special.passwords is the function we're looking for.  Ctrl-J, etc.  Look down in there, and it seems that the passwords are in user.radio.prefs.passwords.  Ctrl-J, etc.  And it looks like we're there!  Mine is hex encoded, for some reason, but that's easy to get around.


So, there you have it.  If you have lost your Radio UserLand password, but still have a copy of Radio that knows the password, you can find it like this:



  1. Open the Radio console

  2. Hit Ctrl-; (yes, control-semicolon)

  3. Type user.radio.prefs.passwords.default

  4. Click the 'Run' button

Your password should show up at the bottom of the little window that appeared when you hit Ctrl-;.


Phew!

Comment

Interlinking. Today's change: updates, rankings, and referrers now have more links between them. From the updates page you can get to the rankings page, and by clicking on a blog name in the rankings page you get its referrers.

Getting close to version 0.12, we are.

Comment

New version of referrer ranking script up. GB has done a new referrer ranking script that has a cool new feature: sorting by referrer, last reference or count. Nice.

Testing it now - check it out and tell me if it's going for you.

Comment

Testing blog rankings. PyCS version 0.12 will have blog rankings, just like RCS. Finally!

Georg's implementation of the counter script and referrer rankings spurred me on to go and code this last little bit of functionality. It's currently being tested on pycs.net. It's in CVS now, so feel free to test it out if you're brave. Otherwise, it will appear in the upcoming 0.12 release after it's been tested for a bit.

Incidentally, I added Georg's code last night, so you can get that now as version 0.11 if you like. 0.12 isn't far off, though.

Comment

New community server. Georg Bauer is running a Python Community Server at Muensterland.org. He's also made some changes - contributed code to get the hit counting and referrer tracking in PyCS working the same way as RCS - automatically, so you don't need to hack around with cron jobs and Apache logs. Thanks, Georg! I'll be looking at the patches soon and hopefully making the 0.11 release sometime in the next week or two. For the impatient, you can see the code at work by comparing his clean, concise referrer log (new code) with my complete but messy one (old code).

One cool thing about his server is that he's translated the front page into German and made a customised Radio installer so you can quickly and easily set up a blog on his system. So, German Radio users - looks like this is where you should be hosting your blog ;-)

He's also written an essay on PyCS and Radio, and why Radio makes PyCS into much more than just an FTP server and a web server. Or at least that's what I could understand from the Babelfish translation. Nice.

Comment

ANNOUNCEMENT: Python Community Server v0.10 now available!.

The Python Community Server freshmeat page is telling me that the last time I did a proper SourceForge/freshmeat release for PyCS was 2 June, 2002.  For some reason I don't seem to have blogged about it (1/2).


Anyway, here's a quick note to say that Python Community Server version 0.10, complete with an improved installer, an updated howto, and a nice cleanup by Michael Hay to make it run as a proper daemon, is out!


To get one yourself, get yourself a Unix box (it's been tested on Linux and FreeBSD), read the aforementioned howto, and get going!  Alternatively, I can host one for you, with all the bells and whistles: comments, authentication, nice URLs.

Comment

Back to mono. Someone contacted me a couple of days ago about a bug in my small contributions to Mono, System.Net.Sockets.TcpClient and TcpListener.  However, I haven't touched that code for quite a while, and it looks like the SSH key I need to commit to the repository was nearly lost on my old Windows 2000 partition.  Heh.  Coming back up to speed on the project now.

Comment

Note to self. Read this article about programmatically creating Access databases from within C#.

This is something I need to make DbWrappers do for it to really save developer time.

For the uninitiated, DbWrappers is a tool that makes C# code out of database definitions (in XML), so you can do stuff like:

using ( MyReader r = MyTable.SelectMany( null, null ) ) {
    while ( r.Read() ) {
        MyRow row = foo.Row;
        // (now do something with 'row', like drop it in an ArrayList)
    }
}

That saves you a few hundred lines of code, and makes database refactoring somewhat less painful - you only need to change two bits of code, not about 5.

Anyway, if I can get it to generate its own tables, you'll only need to change one bit of code, which is perfect.

Comment

Upstreaming to a Radio Community Server without Radio. I see that Christian Crumlish wants to put a file on his defunct space at Salon.Com that he has abandoned for a slightly nicer URL, and now wants to upstream files to that server to finish off the job of redirecting his old RSS feed to the new location.

Unfortunately, his copy of Radio is now set up to upstream to the FTP server for his new site, and he can't get it posting back to Salon. Here's a quick solution for him - a little bit of Python code to just upstream a single file to a community server.

Download this --> upone.py

You need to have Python installed. Just download the installer from that link and accept all the defaults (if you're on Windows, which presumably you are if you're using Radio). Once you've installed it, open a command prompt in the directory you saved upone.py into, and type:

upone.py (server RPC URL) (usernum) (password) (local filename) (remote filename)

If you're upstreaming to blogs.salon.com, you want:

upone.py http://rcs.salon.com/RPC2 (usernum) (password) (local filename) (remote filename)

And Christian wants to make a file called rss.xml in the same directory as upone.py and run:

upone.py http://rcs.salon.com/RPC2 0001111 (password) rss.xml rss.xml

Look for the bit in the response starting with "message" and make sure it says something positive. If not, and you can't figure out what's gone wrong, drop me a line (there's a mail link on this page somewhere) and I'll help you out.

Comment

Testing the new weblogs.com RSS RPC URL. Hmm ... RSS pings to Weblogs.Com are now meant to go to rssrpc.weblogs.com/RPC2. This post is a test to make sure I've got it right in bzero.

Comment