http://prolificprogrammer.com/blog/2007/02/09/free_trinity_save_the_w... What I did was comb through the Nokia N-800 documentation -- no, I don't have one as yet. It does run python, so I've written the code in python. I am willing to rewrite parts of it in C if the python proves too slow. I could not find the camera API, but the code uploads a picture taken from the camera every 5 minutes to flickr with the tag 'trinity'. You need to fill the api key as well as the secret. I tested the code out with my Symbian phone (Nokia 6620) for an hour and it uploaded 12 pictures. Let me know how things work out.
Finally, the best way to reach me is to leave a comment at the above blog or by IM (links are given on http://prolificprogrammer.com/blog).
You should include meyercr (his name on this group) on the N800 coding side. He is writing something to take GPS data and upload it as GPX to a tracking site (mine is the tentative target). It could be sensible to bundle all the N800 code together. He has an N800 so can try out your progs too.
On Feb 9, 12:38 am, "Prolific Programmer" <hasan.di...@gmail.com> wrote:
> http://prolificprogrammer.com/blog/2007/02/09/free_trinity_save_the_w... > What I did was comb through the Nokia N-800 documentation -- no, I > don't have one as yet. It does run python, so I've written the code in > python. I am willing to rewrite parts of it in C if the python proves > too slow. I could not find the camera API, but the code uploads a > picture taken from the camera every 5 minutes to flickr with the tag > 'trinity'. You need to fill the api key as well as the secret. I > tested the code out with my Symbian phone (Nokia 6620) for an hour and > it uploaded 12 pictures. Let me know how things work out.
> Finally, the best way to reach me is to leave a comment at the above > blog or by IM (links are given onhttp://prolificprogrammer.com/blog).
On Feb 9, 7:24 am, "Crudson" <crud...@gmail.com> wrote:
> You should include meyercr (his name on this group) on the N800 coding > side. He is writing something to take GPS data and upload it as GPX to > a tracking site (mine is the tentative target). It could be sensible > to bundle all the N800 code together. He has an N800 so can try out > your progs too.
Cool. How do I "include meyercr" aside from posting the code on my blog and pointing the group to it? Cheers
On 9 feb, 19:19, "Prolific Programmer" <hasan.di...@gmail.com> wrote:
> Crudson:
> On Feb 9, 7:24 am, "Crudson" <crud...@gmail.com> wrote:
> > You should include meyercr (his name on this group) on the N800 coding > > side. He is writing something to take GPS data and upload it as GPX to > > a tracking site (mine is the tentative target). It could be sensible > > to bundle all the N800 code together. He has an N800 so can try out > > your progs too.
> Cool. How do I "include meyercr" aside from posting the code on my > blog and pointing the group to it? > Cheers
Let's summerize on what we need to implement (Adam, this is where you could also help steer us in the right direction):
1.) Photo uploader to Flickr or PicasaWeb (could be done through the website or specific APIs) 2.) Podcast uploader, both for video and audio (could be done through the website or specific APIs) 3.) Auto. GPS location updater of Trinity to somewhere reformating it into a map. 4.) Auto. GPS location downloader for the waypoints of interest (fuel, podcaster/passengers/giggs/...) controller from the HQ.
What do we not need (because this N800 has it by default)
1.) IM 2.) Media player 3.) RSS Reader (possibly unusable if the XML-files that are downloaded are assimulated into a general file of the reader). 4.) Internet calling with video (nice for a show that goes live or something)
What do have to work with in the first place?
1.) Debian based machine (possibly Xscale, but non-the less powerfull) 2.) Powerfull scripting tools (from bash to perl to python) 3.) And big community fun :-)
Can we have a company descision on a few things:
1.) We'll need to agree on what is needs to be implemented 2.) Which system will be used as a directory (or list) that will hold the waypoints of interest that people could follow as also it could be followed by the Podcasting that drive Trinity around our ever smaller Planet? Like: the Any-XML-based flatfile, Google Earth/Maps or Yahoo Maps (and thus their format). It's easy to create something that works, but we would need to know such details to get pointed into the right directions. 3.) To were and what kind of system would the GPS be needing to be published? 4.) What GPS device is used, each has its own little diff in their protocols 5.) Who can we bother to test our stuff on? I can test stuff on my Ubuntu machine (debian like) but that isn't a fully functional test with comparison to the N800, I think.
> 1.) Photo uploader to Flickr or PicasaWeb (could be done through the > website or specific APIs) > 2.) Podcast uploader, both for video and audio (could be done through > the website or specific APIs) > 3.) Auto. GPS location updater of Trinity to somewhere reformating it > into a map. > 4.) Auto. GPS location downloader for the waypoints of interest (fuel, > podcaster/passengers/giggs/...) controller from the HQ.
This would basically result into a Linux (or platform independent) version of a Media uploader to Podshow. XML-RPC is support in a lot of environments so, ok, we can have a look at that. I'll try to hack and chop something.
Maybe it's cool to have a push-pin for Trinity's current location and several push-pins for each podcast (audio or video) location. It would be cool to have a balloon pop-up on the map with the show-notes plus a link to download the audio/video file.
I think the instructions to Trinity could be send through: SMS (/TEXT) service to a phone, Instant Messenging or just (plain) E-Mail. With both Yahoo and Google mail you can have atleast two ways of fetching your email.
If the N800 can run GAIM as IM tool, then your good for MSN, Yahoo and Google Talk all in one tool. Which would give you the most flexibility I guess. That's quite a proven tool. Maybe Nokia has included something else.
Cheers
On 9 feb, 22:20, "Adam Curry" <foobar...@gmail.com> wrote:
> Perhaps it is best to upload all media through a common api. PodShow > supports the metaaWeblogAPI.
> pictures, audio and video should be recorded and uploded at regular > iintervals.
> gps data sent to HQ shouldd be displayable on a map and as an option > in Google Earth.
> Interesting thought to have a data stream downloaded to a display in > Trinity with 'instructions'.
> AC
> > 1.) Photo uploader to Flickr or PicasaWeb (could be done through the > > website or specific APIs) > > 2.) Podcast uploader, both for video and audio (could be done through > > the website or specific APIs) > > 3.) Auto. GPS location updater of Trinity to somewhere reformating it > > into a map. > > 4.) Auto. GPS location downloader for the waypoints of interest (fuel, > > podcaster/passengers/giggs/...) controller from the HQ.
First sub-project: Uploading a show with minimal coding.
- Tinn-foil hat warning -
Just to hint on where I'm at, first of all this is the trigger (or excuse) to learn a new programming language. I've never done anything with the snake language Python, I'm also learning XML-RPC at the same time and the libs that are used here and guess what ... I'm just excited.
I've got the PDN (Podshow Delivery Network) to talk to me. And I'm going to try to upload a little test-show to the PDN. If that works (probably the hardest part) then I'm going to gooff around with the possibilities. One of the major issues to do something that hasn't done before, is uploading a show and adding my GPS coordinates as extended metadata to my test-show(s).
If hell doesn't break lose on my computer (and in the house-hold) I should be having a testable thingy tomorrow.
> 1.) We'll need to agree on what is needs to be implemented > 2.) Which system will be used as a directory (or list) that will hold > the waypoints of interest that people could follow as also it could be > followed by the Podcasting that drive Trinity around our ever smaller > Planet? Like: the Any-XML-based flatfile, Google Earth/Maps or Yahoo > Maps (and thus their format). It's easy to create something that > works, but we would need to know such details to get pointed into the > right directions.
Google maps terms of use has a provision that you can't use it for any sort of navigation system. Yahoo Maps has fewer restrictions. I'd put the POIs in a flat file and just read that in.
> 3.) To were and what kind of system would the GPS be needing to be > published? > 4.) What GPS device is used, each has its own little diff in their > protocols > 5.) Who can we bother to test our stuff on? I can test stuff on my > Ubuntu machine (debian like) but that isn't a fully functional test > with comparison to the N800, I think.
Adam has indicated that he could get a few N-800s for testing, IIRC. Cheers,
On 10 feb, 23:00, "Prolific Programmer" <hasan.di...@gmail.com> wrote:
> On Feb 9, 11:03 am, "Oscar" <okoe...@gmail.com> wrote:
> > 1.) Photo uploader to Flickr or PicasaWeb (could be done through the > > website or specific APIs)
> The code I've posted does this. Seehttp://prolificprogrammer.com/blog/ > 2007/02/09/free_trinity_save_the_world.html for details and code.
It surely needs some Human Interfacing though, but it's nice to have that already covered. Can you also control the creation of video files (plus there upload with that api?
> > 1.) We'll need to agree on what is needs to be implemented > > 2.) Which system will be used as a directory (or list) that will hold > > the waypoints of interest that people could follow as also it could be > > followed by the Podcasting that drive Trinity around our ever smaller > > Planet? Like: the Any-XML-based flatfile, Google Earth/Maps or Yahoo > > Maps (and thus their format). It's easy to create something that > > works, but we would need to know such details to get pointed into the > > right directions.
> Google maps terms of use has a provision that you can't use it for any > sort of navigation system. Yahoo Maps has fewer restrictions. I'd put > the POIs in a flat file and just read that in.
That's a bummer from Google. Nevertheless it would indeed be wise to create a context free file as a source to any Google Maps/Earth or Yahoo Maps like thingy.
> > 3.) To were and what kind of system would the GPS be needing to be > > published? > > 4.) What GPS device is used, each has its own little diff in their > > protocols > > 5.) Who can we bother to test our stuff on? I can test stuff on my > > Ubuntu machine (debian like) but that isn't a fully functional test > > with comparison to the N800, I think.
> Adam has indicated that he could get a few N-800s for testing, IIRC.
That would be very nice to have. Because testing on my desktop is one thing...
On Feb 11, 7:37 am, "Oscar" <okoe...@gmail.com> wrote:
> It surely needs some Human Interfacing though, but it's nice to have > that already covered. Can you also control the creation of video files > (plus there upload with that api?
Adam said he'd like to use the podshow/metaweblog API previously in this thread to control all uploading and downloading. Creation of the files relies on familiarity with the N-800, which I have yet to obtain. I'll see if I can port my code to the metaweblog API.
> That's a bummer from Google. Nevertheless it would indeed be wise to > create a context free file as a source to any Google Maps/Earth or > Yahoo Maps like thingy.
Well, there is an EXIF geocoding standard and a space in the RSS file for an icon. All we need to do to tag location is to add the EXIF tag to the item's icon (each item can have its own icon). I'm back home now, but will be off again to Toronto for the long weekend. Will see if I can get code written to tag the icon and upload using the metaweblog api by tomorrow and post it on my blog. Cheers
> I'll see if I can port my code to the metaweblog API.
As a followup to my own post... My previously posted code has been ported to metaweblog and is posted at http://prolificprogrammer.com/ blog/2007/02/12/free_trinity_update.html -- your comments are welcome. Cheers
So I've been been battling yesterday with the follow tidbit:
import xmlrpclib import base64
data = open("../tranny.mp3", "rb").read() edata = base64.encodestring(data)
class MyItem: pass class MyEnclosure: pass class MyPost: pass
e = MyEnclosure() e.name = "Testing_with_tranny" e.bits = edata e.type = "audio/mpeg" e.title = "My first geeky Podcast" e.pubDate = "Mon, 12 Feb 07 01:00:00 GMT" e.isExplicit = "true" e.description = "My Big test with Python (the snakes language), XML- RPC and the use of it all" e.tags = "snakes,python,XML-RPC,test,geek"
> > I'll see if I can port my code to the metaweblog API.
> As a followup to my own post... My previously posted code has been > ported to metaweblog and is posted athttp://prolificprogrammer.com/ > blog/2007/02/12/free_trinity_update.html -- your comments are welcome. > Cheers
On 12 feb, 09:20, "Oscar" <okoe...@gmail.com> wrote:
> Hi PP,
> As said earlier, I'm a Python n00b.
> So I've been been battling yesterday with the follow tidbit:
> [...snip...]
> I'll try your example since you've created the required struct > differently.
Hi again,
I've tryed your script and stumbled upon the same error message. Do our xmlrpc libs convert the objects correctly into the expected XML? Maybe Andrew Grumet could help us bootstrap the details by supplying a slightly more detailed error message.
> On 12 feb, 03:37, "Prolific Programmer" <hasan.di...@gmail.com> wrote:
> > > I'll see if I can port my code to the metaweblog API.
> > As a followup to my own post... My previously posted code has been > > ported to metaweblog and is posted athttp://prolificprogrammer.com/ > > blog/2007/02/12/free_trinity_update.html -- your comments are welcome. > > Cheers
Happy to try this out in my N800 if you can give me install instructions. seems like some local variables specific to the N800 still need to be figured out?
AC
On Feb 12, 8:45 am, "Oscar" <okoe...@gmail.com> wrote:
> On 12 feb, 09:20, "Oscar" <okoe...@gmail.com> wrote:
> > Hi PP,
> > As said earlier, I'm a Python n00b.
> > So I've been been battling yesterday with the follow tidbit:
> > [...snip...]
> > I'll try your example since you've created the required struct > > differently.
> Hi again,
> I've tryed your script and stumbled upon the same error message. Do > our xmlrpc libs convert the objects correctly into the expected XML? > Maybe Andrew Grumet could help us bootstrap the details by supplying a > slightly more detailed error message.
> cheers,
> > Cheers
> > On 12 feb, 03:37, "Prolific Programmer" <hasan.di...@gmail.com> wrote:
> > > > I'll see if I can port my code to the metaweblog API.
> > > As a followup to my own post... My previously posted code has been > > > ported to metaweblog and is posted athttp://prolificprogrammer.com/ > > > blog/2007/02/12/free_trinity_update.html -- your comments are welcome. > > > Cheers
> First sub-project: Uploading a show with minimal coding.
> - Tinn-foil hat warning -
> Just to hint on where I'm at, first of all this is the trigger (or > excuse) to learn a new programming language. > I've never done anything with the snake language Python, I'm also > learning XML-RPC at the same time and the libs that are used here and > guess what ... I'm just excited.
> I've got the PDN (Podshow Delivery Network) to talk to me. And I'm > going to try to upload a little test-show to the PDN. If that works > (probably the hardest part) then I'm going to gooff around with the > possibilities. > One of the major issues to do something that hasn't done before, is > uploading a show and adding my GPS coordinates as extended metadata to > my test-show(s).
> If hell doesn't break lose on my computer (and in the house-hold) I > should be having a testable thingy tomorrow.
> On Feb 10, 4:14 pm, "Oscar" <okoe...@gmail.com> wrote:
> > Hi all,
> > First sub-project: Uploading a show with minimal coding.
> > - Tinn-foil hat warning -
> > Just to hint on where I'm at, first of all this is the trigger (or > > excuse) to learn a new programming language. > > I've never done anything with the snake language Python, I'm also > > learning XML-RPC at the same time and the libs that are used here and > > guess what ... I'm just excited.
> > I've got the PDN (Podshow Delivery Network) to talk to me. And I'm > > going to try to upload a little test-show to the PDN. If that works > > (probably the hardest part) then I'm going to gooff around with the > > possibilities. > > One of the major issues to do something that hasn't done before, is > > uploading a show and adding my GPS coordinates as extended metadata to > > my test-show(s).
> > If hell doesn't break lose on my computer (and in the house-hold) I > > should be having a testable thingy tomorrow.
I've found out that the xmlrpclib basically creates the same XML output out of both our approaches either using a dict() or just a class with the named variables. Nevertheless we get the same error. I've launched a question to Andrew G. on the PDN comments section.
Here is a cleaned version of your script. I've fixed few tiny things to let it work but halt at the error code 800 :)
AC: You might be able to copy this script to the N800 and launch (after filling in your own uname and passwd) it with: python <filename>.py
# Connect to the PDN s=xmlrpclib.Server(PODSHOW_SERVER_ENDPOINT)
# Get my Info bloginfo = s.blogger.getUsersBlogs('', blogid.login, blogid.pwd)
# Populate some more blog information for myself blogid.id = bloginfo[0]['blogid'] blogid.url = bloginfo[0]['url'] blogid.blogName = bloginfo[0]['blogName']
uploadInfo['bits'] = 556095 # can we auto-detect this easily? possibly first FTP the media file somewhere (would solve comic-strip blogger's XML-RPC non-resume request) s.metaWeblog.newMediaObject(blogid.id, blogid.login, blogid.pwd, uploadInfo)
On 12 feb, 12:08, "Adam Curry" <foobar...@gmail.com> wrote:
> Happy to try this out in my N800 if you can give me install > instructions. seems like some local variables specific to the N800 > still need to be figured out?
> AC
I didn't answer this yet. The answer is No, you don't need anything extra. As a client it will only need to know the URL of the XML-RPC end-point. Which is 'http://www.podshow.com/xmlrpc/pdn'.
The only thing that needs to be done on the N800 side is executing this script and thus make the call over the Internet to the PDN. I guess that if you execute this script then the N800 would try to gain access to the Internet automagically, like my phone would do when trying to work online. Which is basically no different then browsing webpages since XML-RPC is build on top of the HTTP protocol.
> On Feb 12, 8:45 am, "Oscar" <okoe...@gmail.com> wrote:
> > On 12 feb, 09:20, "Oscar" <okoe...@gmail.com> wrote:
> > > Hi PP,
> > > As said earlier, I'm a Python n00b.
> > > So I've been been battling yesterday with the follow tidbit:
> > > [...snip...]
> > > I'll try your example since you've created the required struct > > > differently.
> > Hi again,
> > I've tryed your script and stumbled upon the same error message. Do > > our xmlrpc libs convert the objects correctly into the expected XML? > > Maybe Andrew Grumet could help us bootstrap the details by supplying a > > slightly more detailed error message.
> > > > > I'll see if I can port my code to the metaweblog API.
> > > > As a followup to my own post... My previously posted code has been > > > > ported to metaweblog and is posted athttp://prolificprogrammer.com/ > > > > blog/2007/02/12/free_trinity_update.html -- your comments are welcome. > > > > Cheers
Does podshow offer a SOAP API? We seem to have run into a bug with Andrew Grommit's api documentation at http://developer.podshow.com/apis/pdn/authoring/ -- namely, that the listUsersBlogs call returns a blank to me -- not to mention the post naturally fails.
We might have miss understood on the private email, but that blank return is actually correct. I didn't understood that last Sunday afternoon (local time to me is Central European Time) but the basic thing is that you'll need to create a show place holder in the system. It wasn't specified in the API specs, but you'll need to create a show placeholder first.
Then when you call "blogger.getUsersBlogs()" it will return a python dict() like three strings struct inside of a one celled array:
[code snip] # Get my Info bloginfo = s.blogger.getUsersBlogs('', blogid.login, blogid.pwd)
# Populate some more blog information for myself blogid.id = bloginfo[0]['blogid'] blogid.url = bloginfo[0]['url'] blogid.blogName = bloginfo[0]['blogName'] [/code snip]
This part was working :-) No need to convert to SOAP for that yet. There is something phishy with newMediaObject(). Something very specific is requested/required and I don't understand what it is. The error message is non- selfexplanitory (is that actually a word).
Cheers
On 12 feb, 22:37, "Prolific Programmer" <hasan.di...@gmail.com> wrote:
> Does podshow offer a SOAP API? We seem to have run into a bug with > Andrew Grommit's api documentation athttp://developer.podshow.com/apis/pdn/authoring/ > -- namely, that the listUsersBlogs call returns a blank to me -- not > to mention the post naturally fails.
> I've found out that the xmlrpclib basically creates the same XML > output out of both our approaches either using a dict() or just a > class with the named variables. Nevertheless we get the same error. > I've launched a question to Andrew G. on the PDN comments section.
> Here is a cleaned version of your script. I've fixed few tiny things > to let it work but halt at the error code 800 :)
> AC: You might be able to copy this script to the N800 and launch > (after filling in your own uname and passwd) it with: python > <filename>.py
> # Connect to the PDN > s=xmlrpclib.Server(PODSHOW_SERVER_ENDPOINT)
> # Get my Info > bloginfo = s.blogger.getUsersBlogs('', blogid.login, blogid.pwd)
> # Populate some more blog information for myself > blogid.id = bloginfo[0]['blogid'] > blogid.url = bloginfo[0]['url'] > blogid.blogName = bloginfo[0]['blogName']
OK, I have the script working on the N800, and before I test it against the PDN, I need to know how to select the correct blogId, as I have multiple shows under my PS+ account, yet I don't see a variable in the script I can change to ensure the upload goes to the right place.
> On 12 feb, 12:08, "Adam Curry" <foobar...@gmail.com> wrote: > > Happy to try this out in my N800 if you can give me install > > instructions. seems like some local variables specific to the N800 > > still need to be figured out?
> > AC
> I didn't answer this yet. The answer is No, you don't need anything > extra. As a client it will only need to know the URL of the XML-RPC > end-point. Which is 'http://www.podshow.com/xmlrpc/pdn'.
> The only thing that needs to be done on the N800 side is executing > this script and thus make the call over the Internet to the PDN. I > guess that if you execute this script then the N800 would try to gain > access to the Internet automagically, like my phone would do when > trying to work online. Which is basically no different then browsing > webpages since XML-RPC is build on top of the HTTP protocol.
> Cheers,
> > On Feb 12, 8:45 am, "Oscar" <okoe...@gmail.com> wrote:
> > > On 12 feb, 09:20, "Oscar" <okoe...@gmail.com> wrote:
> > > > Hi PP,
> > > > As said earlier, I'm a Python n00b.
> > > > So I've been been battling yesterday with the follow tidbit:
> > > > [...snip...]
> > > > I'll try your example since you've created the required struct > > > > differently.
> > > Hi again,
> > > I've tryed your script and stumbled upon the same error message. Do > > > our xmlrpc libs convert the objects correctly into the expected XML? > > > Maybe Andrew Grumet could help us bootstrap the details by supplying a > > > slightly more detailed error message.
> > > > > > I'll see if I can port my code to the metaweblog API.
> > > > > As a followup to my own post... My previously posted code has been > > > > > ported to metaweblog and is posted > athttp://prolificprogrammer.com/ > > > > > blog/2007/02/12/free_trinity_update.html -- your comments are > welcome. > > > > > Cheers
Good point... I only have one show place holder myself, so I had just pre-selected that one existing show (blogid) directly.
This going to get nasty... here are two scripts...
To see what which shows you have and thus to be able to determine the blogid to put into the second script.
-> Alter the username and passwd and you'll get your list of results.
---- Begin of script one ---- import xmlrpclib, mimetypes, base64, datetime PODSHOW_SERVER_ENDPOINT = 'http://www.podshow.com/xmlrpc/pdn' # According to Andrew Grommet s=xmlrpclib.Server(PODSHOW_SERVER_ENDPOINT)
# Get my Info bloginfo = s.blogger.getUsersBlogs('', blogid.login, blogid.pwd)
for x in (bloginfo): print "--------------" print "Show details:" print "blogid: " + x['blogid'] print "url: " + x['url'] print "BlogName: " + x['blogName'] print "--------------" ---- End of script one ----
I've figured that the file you wish to upload needs to be local on the disk. Well ... fair enough you can download the file: http:// www.nikhef.nl/~okoeroo/tranny.mp3 to be uploaded (for easy testing, in the same directory as the test script.
---- Begin of script two ---- import xmlrpclib, mimetypes, base64, datetime
class blogid : pass blogid.login = "okoe...@hotmail.com" blogid.pwd = "<my secret>" blogid.id = "<your blogid which you wish to use>"
# local file to upload filename = "tranny.mp3"
print "Reading and Base64 encoding file..." edata = base64.encodestring(open(filename, "rb").read()) print "done, ready to upload..."
# Connect to the PDN s=xmlrpclib.Server(PODSHOW_SERVER_ENDPOINT)
# Compile Show notes and stuff like that uploadInfo=dict() uploadInfo['title'] = "My first Show directly through the interface" uploadInfo['name'] = "tranny.mp3" uploadInfo['type'] = mimetypes.guess_type(uploadInfo['name'])[0] uploadInfo['bits'] = edata uploadInfo['isExplicit'] = "false" uploadInfo['description'] = "<html><body>My first upload through this interface in a quite naked way.</body></html>" uploadInfo['pubDate'] = datetime.datetime.now().strftime("%a, %d %h %Y %H:%M:%S")
class Result: pass r = Result()
print "Show info to upload:" print uploadInfo['title'] print uploadInfo['name'] print uploadInfo['type'] #print uploadInfo['bits'] print uploadInfo['isExplicit'] print uploadInfo['description'] print uploadInfo['pubDate']
print print "Uploading show" r.string, r.string = s.metaWeblog.newMediaObject(blogid.id, blogid.login, blogid.pwd, uploadInfo) print r ---- End of script two ----
Ofcourse this will need to be smoothen with a huge iron, I'm learning the snakes-language along the way. :-) I'd love to here how it goes on your end. Please post the results and don't get scared about the Python output.
Cheers Oscar
On 13 feb, 15:08, "Adam Curry" <a...@podshow.com> wrote:
> OK, I have the script working on the N800, and before I test it against the > PDN, I need to know how to select the correct blogId, as I have multiple > shows under my PS+ account, yet I don't see a variable in the script I can > change to ensure the upload goes to the right place.
> > On 12 feb, 12:08, "Adam Curry" <foobar...@gmail.com> wrote: > > > Happy to try this out in my N800 if you can give me install > > > instructions. seems like some local variables specific to the N800 > > > still need to be figured out?
> > > AC
> > I didn't answer this yet. The answer is No, you don't need anything > > extra. As a client it will only need to know the URL of the XML-RPC > > end-point. Which is 'http://www.podshow.com/xmlrpc/pdn'.
> > The only thing that needs to be done on the N800 side is executing > > this script and thus make the call over the Internet to the PDN. I > > guess that if you execute this script then the N800 would try to gain > > access to the Internet automagically, like my phone would do when > > trying to work online. Which is basically no different then browsing > > webpages since XML-RPC is build on top of the HTTP protocol.
> > Cheers,
> > > On Feb 12, 8:45 am, "Oscar" <okoe...@gmail.com> wrote:
> > > > > So I've been been battling yesterday with the follow tidbit:
> > > > > [...snip...]
> > > > > I'll try your example since you've created the required struct > > > > > differently.
> > > > Hi again,
> > > > I've tryed your script and stumbled upon the same error message. Do > > > > our xmlrpc libs convert the objects correctly into the expected XML? > > > > Maybe Andrew Grumet could help us bootstrap the details by supplying a > > > > slightly more detailed error message.
> > > > > > > I'll see if I can port my code to the metaweblog API.
> > > > > > As a followup to my own post... My previously posted code has been > > > > > > ported to metaweblog and is posted > > athttp://prolificprogrammer.com/ > > > > > > blog/2007/02/12/free_trinity_update.html -- your comments are > > welcome. > > > > > > Cheers
Here's the result from the first script with correct userid and owd filled in:
~ $ python ppOscar.py Traceback (most recent call last): File "ppOscar.py", line 31, in <module> uploadInfo) File "/usr/lib/python2.5/xmlrpclib.py", line 1147, in __call__ File "/usr/lib/python2.5/xmlrpclib.py", line 1437, in __request File "/usr/lib/python2.5/xmlrpclib.py", line 1201, in request File "/usr/lib/python2.5/xmlrpclib.py", line 1340, in _parse_response File "/usr/lib/python2.5/xmlrpclib.py", line 787, in close xmlrpclib.Fault: <Fault 800: "We're sorry but we were unable to process this request."> ~ $
> Good point... I only have one show place holder myself, so I had just > pre-selected that one existing show (blogid) directly.
> This going to get nasty... here are two scripts...
> To see what which shows you have and thus to be able to determine the > blogid to put into the second script.
> -> Alter the username and passwd and you'll get your list of results.
> ---- Begin of script one ---- > import xmlrpclib, mimetypes, base64, datetime > PODSHOW_SERVER_ENDPOINT = 'http://www.podshow.com/xmlrpc/pdn' # > According to Andrew Grommet > s=xmlrpclib.Server(PODSHOW_SERVER_ENDPOINT)
> # Get my Info > bloginfo = s.blogger.getUsersBlogs('', blogid.login, blogid.pwd)
> for x in (bloginfo): > print "--------------" > print "Show details:" > print "blogid: " + x['blogid'] > print "url: " + x['url'] > print "BlogName: " + x['blogName'] > print "--------------" > ---- End of script one ----
> I've figured that the file you wish to upload needs to be local on the > disk. Well ... fair enough you can download the file: http:// > www.nikhef.nl/~okoeroo/tranny.mp3 to be uploaded (for easy testing, in > the same directory as the test script.
> ---- Begin of script two ---- > import xmlrpclib, mimetypes, base64, datetime
> class blogid : pass > blogid.login = "okoe...@hotmail.com" > blogid.pwd = "<my secret>" > blogid.id = "<your blogid which you wish to use>"
> # local file to upload > filename = "tranny.mp3"
> print "Reading and Base64 encoding file..." > edata = base64.encodestring(open(filename, "rb").read()) > print "done, ready to upload..."
> # Connect to the PDN > s=xmlrpclib.Server(PODSHOW_SERVER_ENDPOINT)
> # Compile Show notes and stuff like that > uploadInfo=dict() > uploadInfo['title'] = "My first Show directly through the interface" > uploadInfo['name'] = "tranny.mp3" > uploadInfo['type'] = mimetypes.guess_type(uploadInfo['name'])[0] > uploadInfo['bits'] = edata > uploadInfo['isExplicit'] = "false" > uploadInfo['description'] = "<html><body>My first upload through this > interface in a quite naked way.</body></html>" > uploadInfo['pubDate'] = datetime.datetime.now().strftime("%a, %d %h %Y > %H:%M:%S")
> print > print "Uploading show" > r.string, r.string = s.metaWeblog.newMediaObject(blogid.id, > blogid.login, blogid.pwd, uploadInfo) > print r > ---- End of script two ----
> Ofcourse this will need to be smoothen with a huge iron, I'm learning > the snakes-language along the way. :-) > I'd love to here how it goes on your end. Please post the results and > don't get scared about the Python output.
> Cheers > Oscar
> On 13 feb, 15:08, "Adam Curry" <a...@podshow.com> wrote: > > OK, I have the script working on the N800, and before I test it against > the > > PDN, I need to know how to select the correct blogId, as I have multiple > > shows under my PS+ account, yet I don't see a variable in the script I > can > > change to ensure the upload goes to the right place.
> > > On 12 feb, 12:08, "Adam Curry" <foobar...@gmail.com> wrote: > > > > Happy to try this out in my N800 if you can give me install > > > > instructions. seems like some local variables specific to the N800 > > > > still need to be figured out?
> > > > AC
> > > I didn't answer this yet. The answer is No, you don't need anything > > > extra. As a client it will only need to know the URL of the XML-RPC > > > end-point. Which is 'http://www.podshow.com/xmlrpc/pdn'.
> > > The only thing that needs to be done on the N800 side is executing > > > this script and thus make the call over the Internet to the PDN. I > > > guess that if you execute this script then the N800 would try to gain > > > access to the Internet automagically, like my phone would do when > > > trying to work online. Which is basically no different then browsing > > > webpages since XML-RPC is build on top of the HTTP protocol.
> > > Cheers,
> > > > On Feb 12, 8:45 am, "Oscar" <okoe...@gmail.com> wrote:
> > > > > > So I've been been battling yesterday with the follow tidbit:
> > > > > > [...snip...]
> > > > > > I'll try your example since you've created the required struct > > > > > > differently.
> > > > > Hi again,
> > > > > I've tryed your script and stumbled upon the same error message. > Do > > > > > our xmlrpc libs convert the objects correctly into the expected > XML? > > > > > Maybe Andrew Grumet could help us bootstrap the details by > supplying a > > > > > slightly more detailed error message.
> > > > > > > > I'll see if I can port my code to the metaweblog API.
> > > > > > > As a followup to my own post... My previously posted code has > been > > > > > > > ported to metaweblog and is posted > > > athttp://prolificprogrammer.com/ > > > > > > > blog/2007/02/12/free_trinity_update.html -- your comments are > > > welcome. > > > > > > > Cheers