← Back to team overview

ubuntu-developer-manual team mailing list archive

Re: Developer Manual Sample App

 

On Wed, 2010-06-02 at 07:20 -0700, Rick Spencer wrote:

> I guess we could just write some urllib2 code and then use beautiful
> soup, and use that to make a UI. We could start with a really simple UI
> that dumps a feed into DictionaryGrid.
> 
> I'll give it a start, and see how it goes.
So I tried it out. I wrote this code:

        # Code for other initialization actions should be added here.
        f =
urllib2.urlopen("http://identi.ca/api/statusnet/groups/timeline/8.rss";)
        soup = BeautifulSoup(f.read())
        dents = []
        for item in soup.findAll("item"):
            dent = item.title.contents[0]
            dents.append({"Dent":dent})
        self.grid = DictionaryGrid(dents)
        self.grid.show()
        self.builder.get_object("scrolledwindow1").add(self.grid)

and you can see in the attached screen shot that this quickly created a
usable user interface. To make the app I need to:
1. create the project with quickly
2. edit the UI with Glade
3. import DictionaryGrid and BeautifulSoup
4. download a document using urllib2
5. parse the document with soup and store what I wanted in a dictionary
6. create a DictionaryGrid and display it

Next steps could be to:
1. store the data in desktopcouch
2. load the data from desktop couch
3. create a custom widget to display data (rather than the grid)
4. use gstreamer to record audio/video, upload to U1, and tweet that
5. use gstreamer to play any audio/video that is found in the feed

thoughts? seem like a good direction?

Cheers, Rick

Attachment: Screenshot.png
Description: PNG image


Follow ups

References