> 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."> > ~ $
> > # 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<http://www.nikhef.nl/%7Eokoeroo/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
> > 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.
> > > AC
> > > On 2/12/07, Oscar <okoe...@gmail.com> wrote:
> > > > 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.
Hmm, looks like I'm missing a parameter, here's the output:
~ $ python script2.py Reading and Base64 encoding file... done, ready to upload... Show info to upload: My first Show directly through the interface A Random Podcast None false <html><body>My first upload through this interface in a quite naked way.</body></html> Tue, 13 Feb 2007 17:06:59
Uploading show Traceback (most recent call last): File "script2.py", line 46, in <module> blogid.login, blogid.pwd, uploadInfo) File "/usr/lib/python2.5/xmlrpclib.py", line 1147, in __call__ File "/usr/lib/python2.5/xmlrpclib.py", line 1431, in __request File "/usr/lib/python2.5/xmlrpclib.py", line 1080, in dumps File "/usr/lib/python2.5/xmlrpclib.py", line 623, in dumps File "/usr/lib/python2.5/xmlrpclib.py", line 635, in __dump File "/usr/lib/python2.5/xmlrpclib.py", line 716, in dump_struct File "/usr/lib/python2.5/xmlrpclib.py", line 635, in __dump File "/usr/lib/python2.5/xmlrpclib.py", line 639, in dump_nil TypeError: cannot marshal None unless allow_none is enabled ~ $
> On 2/13/07, Adam Curry <a...@podshow.com> wrote:
> > OK,
> > 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."> > > ~ $
> > > # 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<http://www.nikhef.nl/%7Eokoeroo/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
> > > 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.
> > > > AC
> > > > On 2/12/07, Oscar <okoe...@gmail.com> wrote:
> > > > > 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:
> > > > > > > > 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.
> Hmm, looks like I'm missing a parameter, here's the output:
> ~ $ python script2.py > Reading and Base64 encoding file... > done, ready to upload... > Show info to upload: > My first Show directly through the interface > A Random Podcast > None > false > <html><body>My first upload through this interface in a quite naked > way.</body></html> > Tue, 13 Feb 2007 17 <javascript:void(0)>:06:59
> Uploading show > Traceback (most recent call last): > File "script2.py", line 46, in <module> > blogid.login, blogid.pwd, uploadInfo) > File "/usr/lib/python2.5/xmlrpclib.py", line 1147, in __call__ > File "/usr/lib/python2.5/xmlrpclib.py", line 1431, in __request > File "/usr/lib/python2.5/xmlrpclib.py", line 1080, in dumps > File "/usr/lib/python2.5/xmlrpclib.py", line 623, in dumps > File "/usr/lib/python2.5/xmlrpclib.py", line 635, in __dump > File "/usr/lib/python2.5/xmlrpclib.py", line 716, in dump_struct > File "/usr/lib/python2.5/xmlrpclib.py", line 635, in __dump > File "/usr/lib/python2.5/xmlrpclib.py", line 639, in dump_nil > TypeError: cannot marshal None unless allow_none is enabled > ~ $
> AC
> On 2/13/07, Adam Curry <a...@podshow.com > wrote:
> > > > 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<http://www.nikhef.nl/%7Eokoeroo/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
> > > > 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.
> > > > > AC
> > > > > On 2/12/07, Oscar <okoe...@gmail.com> wrote:
> > > > > > 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:
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 ----
And it will probably result in the same error :-(
I think somebody at Podshow HQ should see some error messages in the server logs. I hope to understand what to fix.
> > 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."> > > ~ $
> > > # 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<http://www.nikhef.nl/%7Eokoeroo/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
> > > 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.
> > > > AC
> > > > On 2/12/07, Oscar <okoe...@gmail.com> wrote:
> > > > > 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:
> > > > > > > > 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.
> # 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")
> > > > 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<http://www.nikhef.nl/%7Eokoeroo/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
> > > > 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.
> > > > > AC
> > > > > On 2/12/07, Oscar <okoe...@gmail.com> wrote:
> > > > > > 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:
> > > > > > > > > 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.
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"
blogid.login, blogid.pwd, uploadInfo) print r ---- End of script two ----
And it will probably result in the same error :-(
I think somebody at Podshow HQ should see some error messages in the server logs. I hope to understand what to fix.
cheers,
Oscar
ps: Ow nice, a new DSC #545, with geeky notes :-)
On 2/13/07, Adam Curry <
a...@podshow.com: <mailto:a...@podshow.com> > wrote: OK,
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."> ~ $
Going to try the new script in a few mins
AC
On 2/13/07, Oscar <okoe...@gmail.com: <mailto:okoe...@gmail.com> > wrote: Hi AC,
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 = '
class blogid : pass blogid.login = "okoe...@hotmail.com
: <mailto:okoe...@hotmail.com> " blogid.pwd = "<my secret>" blogid.id: <http://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']
blogid.id: <http://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: <mailto: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.
> AC
> On 2/12/07, Oscar <okoe...@gmail.com: <mailto:okoe...@gmail.com> > wrote:
> > On 12 feb, 12:08, "Adam Curry" <
foobar...@gmail.com: <mailto: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?
> > 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.
> > > > > 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
Dead on! An Mp3 file has a MIME-type of "audio/mpeg"
My example requires the file to me locally available to be uploaded. Usually the mimetypes module (default in Python) should return the guess of the actual mimetype (it works on my computer).
Maybe Python 2.5 is a bit different (I'll upgrade here).
Where my script says: uploadInfo['type'] = mimetypes.guess_type(uploadInfo['name'])[0]
You can change that to: uploadInfo['type'] = "audio/mpeg"
Oscar
ps: I'll be reading and learning ahead about the Atom specs :-) pss: I must say, enthousiasm kicks ass when trying new stuff!
On 13 feb, 18:26, topdeadcenterpodc...@gmail.com wrote:
> # 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"
> blogid.login, blogid.pwd, uploadInfo) > print r > ---- End of script two ----
> And it will probably result in the same error :-(
> I think somebody at Podshow HQ should see some error messages in the server logs. I hope to understand what to fix.
> cheers,
> Oscar
> ps: Ow nice, a new DSC #545, with geeky notes :-)
> On 2/13/07, Adam Curry < > a...@podshow.com: <mailto:a...@podshow.com> > wrote: OK,
> 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."> > ~ $
> Going to try the new script in a few mins
> AC
> On 2/13/07, Oscar <okoe...@gmail.com: <mailto:okoe...@gmail.com> > wrote: > Hi AC,
> 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 = '
> class blogid : pass > blogid.login = "okoe...@hotmail.com > : <mailto:okoe...@hotmail.com> " > blogid.pwd = "<my secret>" > blogid.id: <http://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")
> blogid.id: <http://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: <mailto: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.
> > AC
> > On 2/12/07, Oscar <okoe...@gmail.com: <mailto:okoe...@gmail.com> > wrote:
> > > On 12 feb, 12:08, "Adam Curry" < > foobar...@gmail.com: <mailto: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?
> > > 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.
> > > > > > 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?
> Dead on! An Mp3 file has a MIME-type of "audio/mpeg"
> My example requires the file to me locally available to be uploaded. > Usually the mimetypes module (default in Python) should return the > guess of the actual mimetype (it works on my computer).
> Maybe Python 2.5 is a bit different (I'll upgrade here).
> Where my script says: > uploadInfo['type'] = mimetypes.guess_type(uploadInfo['name'])[0]
> You can change that to: > uploadInfo['type'] = "audio/mpeg"
> Oscar
> ps: I'll be reading and learning ahead about the Atom specs :-) > pss: I must say, enthousiasm kicks ass when trying new stuff!
> On 13 feb, 18:26, topdeadcenterpodc...@gmail.com wrote: > > RSS is "audio/mpeg", would that be what you need?
> > # 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"
> > blogid.login, blogid.pwd, uploadInfo) > > print r > > ---- End of script two ----
> > And it will probably result in the same error :-(
> > I think somebody at Podshow HQ should see some error messages in the > server logs. I hope to understand what to fix.
> > cheers,
> > Oscar
> > ps: Ow nice, a new DSC #545, with geeky notes :-)
> > On 2/13/07, Adam Curry < > > a...@podshow.com: <mailto:a...@podshow.com> > wrote: OK,
> > 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."> > > ~ $
> > Going to try the new script in a few mins
> > AC
> > On 2/13/07, Oscar <okoe...@gmail.com: <mailto:okoe...@gmail.com> > > wrote: > > Hi AC,
> > 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 = '
> > blogid.id: <http://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: <mailto: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.
> > > AC
> > > On 2/12/07, Oscar <okoe...@gmail.com: <mailto:okoe...@gmail.com> > > wrote:
> > > > On 12 feb, 12:08, "Adam Curry" < > > foobar...@gmail.com: <mailto: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?
> > > > 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
And the upload seemed to go through, but (presumably) at the endo fo th eupload it threw an error:
~ $ python script2.py Reading and Base64 encoding file... done, ready to upload... Show info to upload: My first Show directly through the interface A Random Podcast audio/mpeg false <html><body>My first upload through this interface in a quite naked way.</body></html> Tue, 13 Feb 2007 17:24:13
Uploading show Traceback (most recent call last): File "script2.py", line 47, in <module> blogid.login, blogid.pwd, 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.">
On 2/13/07, topdeadcenterpodc...@gmail.com <topdeadcenterpodc...@gmail.com> wrote:
> # 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"
> blogid.login, blogid.pwd, uploadInfo) > print r > ---- End of script two ----
> And it will probably result in the same error :-(
> I think somebody at Podshow HQ should see some error messages in the > server logs. I hope to understand what to fix.
> cheers,
> Oscar
> ps: Ow nice, a new DSC #545, with geeky notes :-)
> On 2/13/07, Adam Curry < > a...@podshow.com: <mailto:a...@podshow.com> > wrote: OK,
> 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."> > ~ $
> Going to try the new script in a few mins
> AC
> On 2/13/07, Oscar <okoe...@gmail.com: <mailto:okoe...@gmail.com> > wrote: > Hi AC,
> 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 = '
> class blogid : pass > blogid.login = "okoe...@hotmail.com > : <mailto:okoe...@hotmail.com> " > blogid.pwd = "<my secret>" > blogid.id: <http://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")
> blogid.id: <http://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: <mailto: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.
> > AC
> > On 2/12/07, Oscar <okoe...@gmail.com: <mailto:okoe...@gmail.com> > > wrote:
> > > On 12 feb, 12:08, "Adam Curry" < > foobar...@gmail.com: <mailto: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?
> > > 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.
btw, just wanted to mention how excited I am about this script. Th epossibilities start to stack up, once I can get the media onto the N800, I can auto upload it! Very cool.
> And the upload seemed to go through, but (presumably) at the endo fo th > eupload it threw an error:
> ~ $ python script2.py > Reading and Base64 encoding file... > done, ready to upload... > Show info to upload: > My first Show directly through the interface > A Random Podcast > audio/mpeg > false > <html><body>My first upload through this interface in a quite naked > way.</body></html> > Tue, 13 Feb 2007 17 <javascript:void(0)>:24:13
> Uploading show > Traceback (most recent call last): > File "script2.py", line 47, in <module> > blogid.login, blogid.pwd, 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.">
> On 2/13/07, topdeadcenterpodc...@gmail.com <topdeadcenterpodc...@gmail.com> > wrote:
> > RSS is "audio/mpeg", would that be what you need?
> > # 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"
> > blogid.login, blogid.pwd, uploadInfo) > > print r > > ---- End of script two ----
> > And it will probably result in the same error :-(
> > I think somebody at Podshow HQ should see some error messages in the > > server logs. I hope to understand what to fix.
> > cheers,
> > Oscar
> > ps: Ow nice, a new DSC #545, with geeky notes :-)
> > On 2/13/07, Adam Curry < > > a...@podshow.com: <mailto:a...@podshow.com> > wrote: OK,
> > 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."> > > ~ $
> > Going to try the new script in a few mins
> > AC
> > On 2/13/07, Oscar <okoe...@gmail.com: <mailto:okoe...@gmail.com> > > > wrote: > > Hi AC,
> > 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 = '
> > blogid.id: <http://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: <mailto: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.
> > > AC
> > > On 2/12/07, Oscar <okoe...@gmail.com: <mailto: okoe...@gmail.com> > > > wrote:
I think that the N800 is such a powerfull platform.
I'm doing this typing and testing to a.) contribute a valueable cause of this project b.) learn more about the tin-foil hat side of new media (and all the techniques) c.) learning the snakes language along the way d.) and understand that the possibilities are endless e.) get myself wanting to own a N800
And my newest reason is the battle of the minds with the Prolific Programmer :-) All in the good sense of mind of course. I'm distributed computering security systems programmer and I just love community work.
I'll fiddle and test some more.
cheers
On 13 feb, 18:50, "Adam Curry" <a...@podshow.com> wrote:
> btw, just wanted to mention how excited I am about this script. Th > epossibilities start to stack up, once I can get the media onto the N800, I > can auto upload it! Very cool.
> AC
> On 2/13/07, Adam Curry <a...@podshow.com> wrote:
> > And the upload seemed to go through, but (presumably) at the endo fo th > > eupload it threw an error:
> > ~ $ python script2.py > > Reading and Base64 encoding file... > > done, ready to upload... > > Show info to upload: > > My first Show directly through the interface > > A Random Podcast > > audio/mpeg > > false > > <html><body>My first upload through this interface in a quite naked > > way.</body></html> > > Tue, 13 Feb 2007 17 <javascript:void(0)>:24:13
> > Uploading show > > Traceback (most recent call last): > > File "script2.py", line 47, in <module> > > blogid.login, blogid.pwd, 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.">
> > On 2/13/07, topdeadcenterpodc...@gmail.com <topdeadcenterpodc...@gmail.com> > > wrote:
> > > RSS is "audio/mpeg", would that be what you need?
> > > # 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"
Thanks to Andrew Grumet's email reply I only needed to alter a tiny part of the line and *BOOM* it works. I've been able to upload my Mp3 file and download and play it from the Podshow.com website (== equals cool!)
Try this script, it will replace script Number 2. The first is still needed to select the show you wish to use.
---- begin script 2 ---- import xmlrpclib, mimetypes, base64, datetime
print "Reading and creating binary object from file..." #edata = base64.encodestring(open(filename, "rb").read()) edata = xmlrpclib.Binary(open(filename, "rb").read()) print "done, ready to upload..."
# Connect to the PDN s=xmlrpclib.Server(PODSHOW_SERVER_ENDPOINT)
#Create uploadInfo (with MIME/Type forced to "audio/mpeg" uploadInfo=dict() uploadInfo['title'] = "My first Show directly through the interface" uploadInfo['name'] = "tranny.mp3" uploadInfo['type'] = "audio/mpeg" 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")
> And the upload seemed to go through, but (presumably) at the endo fo th > eupload it threw an error:
> ~ $ python script2.py > Reading and Base64 encoding file... > done, ready to upload... > Show info to upload: > My first Show directly through the interface > A Random Podcast > audio/mpeg > false > <html><body>My first upload through this interface in a quite naked > way.</body></html> > Tue, 13 Feb 2007 17:24:13
> Uploading show > Traceback (most recent call last): > File "script2.py", line 47, in <module> > blogid.login, blogid.pwd, 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.">
> On 2/13/07, topdeadcenterpodc...@gmail.com <topdeadcenterpodc...@gmail.com> > wrote:
> > RSS is "audio/mpeg", would that be what you need?
> > # 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"
> > blogid.login, blogid.pwd, uploadInfo) > > print r > > ---- End of script two ----
> > And it will probably result in the same error :-(
> > I think somebody at Podshow HQ should see some error messages in the > > server logs. I hope to understand what to fix.
> > cheers,
> > Oscar
> > ps: Ow nice, a new DSC #545, with geeky notes :-)
> > On 2/13/07, Adam Curry < > > a...@podshow.com: <mailto:a...@podshow.com> > wrote: OK,
> > 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."> > > ~ $
> > Going to try the new script in a few mins
> > AC
> > On 2/13/07, Oscar <okoe...@gmail.com: <mailto:okoe...@gmail.com> > wrote: > > Hi AC,
> > 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 = '
> > # 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'] =
Thanks Oscar, Andrew and all who helped out. This is a perfect start for me. From here I can tinker with directories and small scripts to take user input (show notes) and select a captured file for upload to the PDN, once it's automated we'll be getting very close to the dream of the Trinity Black Box.
> Thanks to Andrew Grumet's email reply I only needed to alter a tiny > part of the line and *BOOM* it works. > I've been able to upload my Mp3 file and download and play it from the > Podshow.com website (== equals cool!)
> Try this script, it will replace script Number 2. The first is still > needed to select the show you wish to use.
> > And the upload seemed to go through, but (presumably) at the endo fo th > > eupload it threw an error:
> > ~ $ python script2.py > > Reading and Base64 encoding file... > > done, ready to upload... > > Show info to upload: > > My first Show directly through the interface > > A Random Podcast > > audio/mpeg > > false > > <html><body>My first upload through this interface in a quite naked > > way.</body></html> > > Tue, 13 Feb 2007 17:24:13
> > Uploading show > > Traceback (most recent call last): > > File "script2.py", line 47, in <module> > > blogid.login, blogid.pwd, 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.">
> > > # 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"
On Feb 13, 9:13 am, "Adam Curry" <a...@podshow.com> wrote:
> Looks like the mimetype, called by: mimetypes.guess_type > (uploadInfo['name'])[0]
Instead of that line, use this snippet: if uploadInfo['name'][0].endswith('.mp3'): # audio files uploadInfo['type']='audio/mpeg' elif uploadInfo['name'][0].endswith('.avi'): # video files uploadInfo['type'] = 'video/x-msvideo' # according to http:// www.idevelopment.info/data/Oracle/DBA_tips/xmldb/XMLDB_2.shtml elif uploadInfo['name'][0].endswith('.html'): # text files uploadInfo['type']='text/html' # and so on... mimetypes.guess_type is supposed to do this in an intelligent manner, I guess it doesn't work properly :(
Yup, your right, I figured that one out this afternoon when I tried to upload a ".3p" video file from my phone (a SE P990i) to the network but it failed on the type. I need to force it to the types. I figured since I'm just a n00b on Python I'd need to: a.) search for a better call to determine that in what I have b.) hope that the MIME/types issues are fixed in Python 2.5.x (I have 2.4.x) c.) create my own function (slave work!) to commit my own function to the standard set by IANA link: http://www.iana.org/assignments/media- types/
So thanks Prolific Programmers, I'll search a bit more, install Python 2.5 somewhere and have a whack at it.
cheers
On 14 feb, 19:10, "Prolific Programmer" <hasan.di...@gmail.com> wrote:
> On Feb 13, 9:13 am, "Adam Curry" <a...@podshow.com> wrote:
> > Looks like the mimetype, called by: mimetypes.guess_type > > (uploadInfo['name'])[0]
> Instead of that line, use this snippet: > if uploadInfo['name'][0].endswith('.mp3'): # audio files > uploadInfo['type']='audio/mpeg' > elif uploadInfo['name'][0].endswith('.avi'): # video files > uploadInfo['type'] = 'video/x-msvideo' # according to http://www.idevelopment.info/data/Oracle/DBA_tips/xmldb/XMLDB_2.shtml > elif uploadInfo['name'][0].endswith('.html'): # text files > uploadInfo['type']='text/html' > # and so on... mimetypes.guess_type is supposed to do this in an > intelligent manner, I guess it doesn't work properly :(
Adam mentioned something about Google Earth earlier in the thread. I'll have code up to generate KML files before close of business Thursday on my blog. KML (Keyhole Markup Language) is the format one uses to distribute Google Earth waypoints. Again, my blog is at http://prolificprogrammer.com/blog -- keep an eye on it. Cheers and happy Valentine's Day to all!
Explanation: the b64 encoding is handled by the xmlrpc backend, you just need to tell it that the object is a binary object and it will do the Right Thing (TM).
> > print > > print "Uploading show" > > r.string, r.string = s.metaWeblog.newMediaObject (blogid.id, > > blogid.login, blogid.pwd, uploadInfo) > > print r > > ---- End of script two ----
> > And it will probably result in the same error :-(
> > I think somebody at Podshow HQ should see some error messages in the > > server logs. I hope to understand what to fix.
> > cheers,
> > Oscar
> > ps: Ow nice, a new DSC #545, with geeky notes :-)
> > On 2/13/07, Adam Curry < a...@podshow.com> wrote:
> > > > OK,
> > > > 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."> > > > > ~ $
> > > > Going to try the new script in a few mins
> > > > AC
> > > > On 2/13/07, Oscar <okoe...@gmail.com> wrote:
> > > > > Hi AC,
> > > > > 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)
> > > > > 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<http://www.nikhef.nl/%7Eokoeroo/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
> > > > > 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.
> > > > > > AC
> > > > > > On 2/12/07, Oscar <okoe...@gmail.com> wrote:
> > > > > > > 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 Feb 14, 1:33 pm, "Prolific Programmer" <hasan.di...@gmail.com> wrote:
> Adam mentioned something about Google Earth earlier in the thread.
The class includes a little test program that writes a kml file in the $HOME directory. I know this environment variable exists in Unix and Symbian. Not so sure about Windows. If it doesn't work, change the line marked "Unix-specific" to the one marked "Microsoft". It creates a KML file with San Francisco indicated. The kml file opens up in Google Earth 4.0.
def __add__(self, placemarkerdict): if not dict(placemarkerdict) == placemarkerdict: raise TypeError, 'KML + dictionary' import datetime self.add_placemarker(placemarkerdict['latitude'], placemarkerdict['longitude'], name = str(datetime.datetime.now())) # Prolific Programmer sees the altitude as unnecessary
That's a nice piece that we can work with. Although I think generating the XML is one thing, but it is depatable if that would be handy on the N800's side. I think that some form of upload mechanism should be created for the coordinates and that the user of the N800 should be able to retrieve a list of (static) POI's.
Also the listeners of the Trinity podcast might just want to have one simple kml file to install which would be the user-friendliest option.
Have a look at this sippet of KML which we use to retrieve some around the world compute cluster information:
create a file with the name: <something>.kml (example: oscar.kml) and launch the file in Google Earth and select the pin-points. This is a nice example of what would be the easiest to install. One KML file that updates at regular intervals (60 seconds here) and the update is another KML file which is incorporated into the whole set of push- pins.
Updateing the list of pushpins (static info.) and having dynamic extra info per push-pin resulting in the map of POIs should not inflict into any licencing issue with the free version of Google at all.
You shouldn't create that much of dynamics in the content as they did for the Tour de France. My collegue let me have a look at that and it was amazingly dynamic! They had (near) real-time updates of all the riders throughout the course including in the mountains.
Keeping it slightly more light weight then that would be the way to go I think.
Cheers
On 15 feb, 02:47, "Prolific Programmer" <hasan.di...@gmail.com> wrote:
> On Feb 14, 1:33 pm, "Prolific Programmer" <hasan.di...@gmail.com> > wrote:> Adam mentioned something about Google Earth earlier in the thread.
> The class includes a little test program that writes a kml file in > the $HOME directory. I know this environment variable exists in Unix > and Symbian. Not so sure about Windows. If it doesn't work, change the > line marked "Unix-specific" to the one marked "Microsoft". It creates > a KML file with San Francisco indicated. The kml file opens up in > Google Earth 4.0.
I appologise for my bad writing skills. I'm better in writing non- natural languages :-)
On 15 feb, 09:27, "Oscar" <okoe...@gmail.com> wrote:
> Hi Prolific, Adam and everybody,
> That's a nice piece that we can work with. Although I think generating > the XML is one thing, but it is depatable if that would be handy on > the N800's side.
It is of course 'debatable'. Besides the language issue I didn't actually tell what I think would be a nicer strategy. I think that it would be wise to upload all media content including frequent GPS coordinate updates of trinity to Podshow HQ. The actual media content is the easy part with the PDN's XML-RPC interface, like Adam wants it. The 'raw-GPS' coordinates could be delivered in the KML structure. Which would enable us to write a tiny parser around that to refactor the KML to some other format of interest (like for the Yahoo maps) and into a Master KML file which would include all the other POIs. This would allow us to create one simple KML file for everybody to install in Google Earth.
I think our contribution is starting to shift from a features display to an intergration of the stuff into one magic for the N800 and the listeners of Free Trinity.
On Feb 15, 12:41 am, "Oscar" <okoe...@gmail.com> wrote:
> I think our contribution is starting to shift from a features display > to an intergration of the stuff into one magic for the N800 and the > listeners of Free Trinity.
Any project has clients as well as developers. Since the "client" in this case is a subscriber, who will be listening in on this through an RSS feed, Google Earth, etc., we need to cater to them too, imo.
NB: I'll be out of town all weekend, but will check back in Monday evening.
> I appologise for my bad writing skills. I'm better in writing non- > natural languages :-)
> On 15 feb, 09:27, "Oscar" <okoe...@gmail.com> wrote:
> > Hi Prolific, Adam and everybody,
> > That's a nice piece that we can work with. Although I think generating > > the XML is one thing, but it is depatable if that would be handy on > > the N800's side.
> It is of course 'debatable'. Besides the language issue I didn't > actually tell what I think would be a nicer strategy. > I think that it would be wise to upload all media content including > frequent GPS coordinate updates of trinity to Podshow HQ. The actual > media content is the easy part with the PDN's XML-RPC interface, like > Adam wants it. The 'raw-GPS' coordinates could be delivered in the KML > structure. Which would enable us to write a tiny parser around that to > refactor the KML to some other format of interest (like for the Yahoo > maps) and into a Master KML file which would include all the other > POIs. This would allow us to create one simple KML file for everybody > to install in Google Earth.
> I think our contribution is starting to shift from a features display > to an intergration of the stuff into one magic for the N800 and the > listeners of Free Trinity.
I haven't actually read the Documentation yet, but im going to tonight, but i was wondering if there was support for, the aforementioned perl, Ive been programming in perl for years, and i would be interested in helping out, anything specific that needs doing?
Thanks Roland
On Feb 15, 8:41 am, "Oscar" <okoe...@gmail.com> wrote:
> I appologise for my bad writing skills. I'm better in writing non- > natural languages :-)
> On 15 feb, 09:27, "Oscar" <okoe...@gmail.com> wrote:
> > Hi Prolific, Adam and everybody,
> > That's a nice piece that we can work with. Although I think generating > > the XML is one thing, but it is depatable if that would be handy on > > the N800's side.
> It is of course 'debatable'. Besides the language issue I didn't > actually tell what I think would be a nicer strategy. > I think that it would be wise to upload all media content including > frequent GPS coordinate updates of trinity to Podshow HQ. The actual > media content is the easy part with the PDN's XML-RPC interface, like > Adam wants it. The 'raw-GPS' coordinates could be delivered in the KML > structure. Which would enable us to write a tiny parser around that to > refactor the KML to some other format of interest (like for the Yahoo > maps) and into a Master KML file which would include all the other > POIs. This would allow us to create one simple KML file for everybody > to install in Google Earth.
> I think our contribution is starting to shift from a features display > to an intergration of the stuff into one magic for the N800 and the > listeners of Free Trinity.
The everlasting battle between Perl & Python. At the lab here we've got an equal amount of perl and python admirers, so I know what you mean. Some lunches are hilarious... ;-)
This Nokia N800 is a beautiful device that runs a Debian like distribution (refactored for the processor), but it's the full-blown real deal. It holds Python 2.5.x so my best guess is that it runs Perl in a quite recent version as good as the Python. Ofcourse we'll probably need to consider the fact that the amount of 3rd party modules/libs are not easily made suitable for the N800. I don't know for sure, I but my best guess is dat it has a Xscale processor as a heart, so possible recompilation on the tablet can possibly be done.
Anywayz... like stated before. We're looking for a few automated ways of uploading media content to the PDN (Podshow Delivery Network). Content like: - photo's - video's - podcasts (audo files) - text - GPS coordinates
...need to be uploaded.
We've kinda covert the automatic picture taking plus geo tagging. Also uploading an Mp3 to the PDN is basically done, possibily simular to the video files. But... I don't think we have a uniformed way of extracting GPS coordinates from a BlueTooth device. This is usually the same as a serial link cable when you need to program such a thing, but from my experiences I understood that not every BlueTooth GPS device is created equally... Garman and other GPS devices have different protocols. And ... there are a few standard of presenting a GPS coordinate. There is the way Google Earth understands it (I belive that was the ISO standard), but there are a few others too. We'll need translaters to accomodate these diffs. If we want to Geo tag a picture, surely we'll need to use the correct format to that api.
maybe you can have a wack at it and maybe (just maybe...) we can have nice project were we can present a unification of Perl and Python function nicely side-by-side. Maybe nobody understands this but a select set of people with many hours behind a keyboard. :-)
> I haven't actually read the Documentation yet, but im going to > tonight, but i was wondering if there was support for, the > aforementioned perl, Ive been programming in perl for years, and i > would be interested in helping out, anything specific that needs > doing?
> Thanks > Roland
> On Feb 15, 8:41 am, "Oscar" <okoe...@gmail.com> wrote: > > Hi again,
> > I appologise for my bad writing skills. I'm better in writing non- > > natural languages :-)
> > On 15 feb, 09:27, "Oscar" <okoe...@gmail.com> wrote:
> > > Hi Prolific, Adam and everybody,
> > > That's a nice piece that we can work with. Although I think generating > > > the XML is one thing, but it is depatable if that would be handy on > > > the N800's side.
> > It is of course 'debatable'. Besides the language issue I didn't > > actually tell what I think would be a nicer strategy. > > I think that it would be wise to upload all media content including > > frequent GPS coordinate updates of trinity to Podshow HQ. The actual > > media content is the easy part with the PDN's XML-RPC interface, like > > Adam wants it. The 'raw-GPS' coordinates could be delivered in the KML > > structure. Which would enable us to write a tiny parser around that to > > refactor the KML to some other format of interest (like for the Yahoo > > maps) and into a Master KML file which would include all the other > > POIs. This would allow us to create one simple KML file for everybody > > to install in Google Earth.
> > I think our contribution is starting to shift from a features display > > to an intergration of the stuff into one magic for the N800 and the > > listeners of Free Trinity.