Ok so here is how you make a simple post using the new python library I’m writing
import wpress blogs = wpress.WP("https://cbaggers.wordpress.com/xmlrpc.php", "username", "password") blog = blogs["Baggers on the Web"] new_post = wpress.WPPost() new_post.title = "First Post Test!" new_post.body = """Hey all! This is my first live test of my python library. In the next post I will show the code used to post this post. Wooo!""" new_post.tags=["wordpress","python"] new_post.live=True blog.append(new_post)
That’s all there is to it! When you connect to wordpress a dict of your blogs is returned, you pull out the one you want and append on a post.
If you want to pull the first 6 posts you do this
import wpress blogs = wpress.WP("https://cbaggers.wordpress.com/xmlrpc.php", "username", "password") blog = blogs["Baggers on the Web"] first_six = blog[:6]
I’m crashing out now but I’m going to post on working with xmlrpc in general soon…there have been some interesting gotchas.
I did…and I found it here
This looks like about the best place to start on my road to Ubuntu development: Getting Started with Ubuntu Development
Cheers to dholbach and everyone in the Ubuntu developer week. I’ll post back how this goes.
I was looking into the uSNChanged value in ldap and saw that (at least in AD) it is not replicated. This meant I would have to query each server individually…then I realised I didnt know how!…turns out I’ve been connecting just by domain, so a quick google later and I found this:
I needed to do this a little while back while making a pythonic circular list. There used to be a command called getslice but this was deprecated a good while ago and replaced with something (in my opinion) more elegent: slice objects.
Read all about it here! (this doco is a little old, but communicates the principles well)
Hey all! This is my first live test of my python library. In the next post I will show the code used to post this post. Wooo!
I’ve been using pyshell as my interactive python shell of choice for quite a while now and being quite happy with it apparently blinkered me as I missed the fantastic bpython . It’s CLI based and provides in-line syntax highlighting and autocompletion, if the others arent quite doing it for you give it a try….hell, give it a try anyway!
This is one of those ideas I expected to go away after a while but its still here especially after skim reading the session IRC log from the last post:
I find watching a IRC + slide session is much better than reading the logs later. Even though its both just text and visuals it feels more ‘alive’ the first time round.
I think I may make a sort of replay tool which lets you watch the session and changes the slides at the correct times. I’m not sure if I will integrate this into something like Lernid or make a tiny dedicated app…hmm!
Yet another thing for the todo list!