Geek Garage

Find inspiration in awesome ideas.

Tag: Web

Parsing RSS feed from an Android device

When it comes to RSS feed parsing, any Java developer will use the org.xml.sax library. But Android provides a nice wrapper that simplifies the code without sacrificing the performances. This wrapper is present since API level 1 and is the easiest way to write a simple parser for any XML.

In this tutorial, I’ll show you how to parse a RSS feed using the android.sax package. I’ll use Geek Garage’s feed. As any XML parsing, using the android.sax package, you can ignore the elements you don’t need, so, I’ll only collect some of the items.

Read More

Modifying a Django Model

We fulfilled the first user story, but we revealed a weakness in our model. Of course this specific situation could have been prevented. But as a lot of weaknesses are revealed during testing, we have to know how to go back to your model. Lets see the consequences on this simple case.

At this stage, a product owner should add a new task which should be “Submitting duplicate data should be rejected with an informative message“. As we observed in the previous post, duplicate SourceUrls share the same URL. So, lets resolve this issue.

Read More

Create your first SourceUrl object.

We have defined our model and created the database tables. But we still didn’t completed the User Story we’ve defined. Using Django, having our model, we’ll just let the framework do the job.

Other frameworks like Ruby on Rails and Grails follow the Convention over Configuration paradigm for that purpose. Django is a little different. Instead of providing a scaffold for forms and display pages, it do provide an entire backend, the admin site.

Read More

Game of Thrones Banner

Game of Thrones, the third season confirms the breaking of all records.

The second episode of Game of Thrones airs tonight. If you haven’t watched the preview, do it before the following spoilers…

Missing from the first episode of this season, Brian, Arya, Jaime and Brienne are back. This episode also introduce The Queen of Thorns, Olenna Tyrell, grandmother of Margaery and Loras Tyrell. The Queen of Thorns should be a major character in this season as she is in the books. She is portrayed by Dame Diana Rigg, best known for her character of Emma Peel in The Avengers.

Read More

Define the models of your RSS reader

Once the project is created, we can focus on its features. Now, we can define our first User Story. In the purpose of our project, we’ll want to follow RSS feeds. We’ll need to inform our software about those feeds. Usually, the first User Story is “I want to see a form to submit my data“. Usually, to complete this User Story, developers focus on the form. That is not the approach with Django. The data is most important than the form, so we’ll start with the data, Django will make the rest much easier.

Django also makes the data manipulation easy with the Model Layer. This is the abstraction layer where you are going to define and manipulate your data model. So first we have to define and tell Django what our data is.

At this step, we plan to build an app which will load, parse and display RSS feeds. So, the system will need to know where to find the feeds, and then to parse all the items. The user should just have to provide the URL of the feed. This will be our first model and form. A very simple model which will let us see how Django deals with it.

Read More

Working with Django and Eclipse.

Before going further on the development of our RSS reader app, lets just have a quick look about the how to work on the project with Eclipse. Actually, if you are planning to dedicate your life to Python and web development, Aptana Studio is certainly a better choice as it is an Eclipse ready to use. But if you want to build your own IDE with the plug-ins of your choice, you’ll certainly use Eclipse. But Eclipse does not support Python out of the box. As I introduced the tools in the first post of this tutorial, you’ll need to add the PyDev plug-in which will give you all the features you need. The manual and especially the Getting Started chapter provides a good explanation about how to configure the plug-in.

The manual also explains how to create a new project and how to import one. There is also a specific page for Django. If you followed the previous step of the tutorial, you already have created the project sources and you’ll need to import them. To understand why and how, lets just see how you would have done directly from Eclipse.

Read More

Start your own RSS reader project, part 2.

So, in the previous post, you have gathered all the tools you need. You can now focus on the project. Thus, before defining our User Stories, we need to create the project. This will start by initiating a project trough Django. This step is nicely described on the Django Tutorial, so in this post, we’ll focus on our specific need. It will be necessary to understanding the terminology used by Django and more specifically what is a Project and what is an Application.

Read More

How to read RSS online ? Make your own site with Python and Django

What is the worst news we heard lately ? Yes, Google is closing Google Reader, which is a major disaster in our lives. How can we read our RSS feeds by now (actually, by the 1st of July) ? Watching the numbers of flowers on Google Reader’s grave, this was still a popular service.

But hey, you are techies, and RSS feeds are simple data easy to parse, so, why don’t you write your own reader page instead of wasting time looking for another service provider ? Of, course, you don’t want to spend too much time on this. Ok, lets do it the easy way, do you know Python and Django ? If not, lets learn how to use them.

Read More

Google spring cleaning, this time it hurts…

Since October 2011, Google shot down some services, softwares or tools. Today, Google announced their last closures. Of course, each time it affects some users, but this time, one service seems to make a lot of noise. And that one is Google Reader.

Read More

Powered by WordPress & Theme by Anders Norén