Personal tools

Andrew Mleczko, blog, aspetti-tecnici

Nov 12, 2014

Scraping cheap airline tickets

It all started with a bet long time ago. One of my friends couldn't believe that it is actually possible nowadays to travel around the world with low-cost airlines.

Because the term low-cost airline is difficult to define we have agreed that we should bet on something easy to check - like the ticket price per kilometer. After some rough checks the bet was on: travel around the world, flying always in one direction (west or east) for less than €0.03 (3 euro cents) per kilometer (imagine Bologna-New York trip for less than €180).

TL;DR

I think I won. With some python help and many hours of coding I was able to find all the necessary tickets and stay below the price criterion. I have learnt a lot about airlines sales strategy... and something about ant colony optimization algorithm. The trip starts on November 15th, maybe you will meet me in the following months ;-)

Problem

Now the long story. Searching for cheap plane ticket is relatively easy task if you have strict dates and simple route (one or two stops). It starts to be more complicated if you want to stop in 3 places. But what if you have 6 stops or more? None of the existing online tools allows you to make such a query (if you know one - let me know). Things get more fuzzy if you don't have specific dates and just want to travel cheap. Searching manually is not an option: ticket price is likely to change daily and number of possible queries is quite big, I mean really big. Imagine you want to take 5 stops and search with margin of ± 10 days. It gives you 9765625 queries (5^10). Grabbing that data directly from airline database is also not doable. There is no standard approach, most of the small companies have their own system - others use providers that are much too expensive for a single user.

Sooner or later you will start to write a script.

read more

Oct 16, 2012

Plone Conference 2012 from RedTurtle's perspective

Plone Conference 2012 photo

Plone Conference 2012 from RedTurtle's perspective

It's all over. 5 days with fellow Plonistas in Arnhem, Netherlands. How was it? Read our summary. One thing we are pretty sure - it was the best conference ever

This year's conference was organized for the 10th time by the FourDigits team. They did great job - everything went smoothly - no problems with network, free places in the rooms, video streaming. Even the weather was a pleasant surprise. But above all there were 4 things this conference will be remembered for a very long time:


read more

Jun 27, 2012

Earthquake? Plone to the rescue!

www.facciamoadesso.it

Earthquake? Plone to the rescue!

To work in Italy you need to be pragmatic. Very pragmatic. That's why when an earthquake hit our region last month we were more than happy to help. Check out what we have done in 72h using Plone, Pyramid and Facebook

The idea behind the project is simple: build a tool that will help suffered companies to sell their products. It should be intuitive and integrates with social networks to gain publicity. You probably heard about the parmigiano reggiano losses and the huge will to buy all the cheese that was left. Our project should help people do it much easier.

Check the site: www.facciamoadesso.it

Plone

Most of the application is done in Plone, which is so fast to develop nowadays. We have used heavily eea.facetednavigation which saved us hours if not days. Big thanks to Alin Voinea, Alexandru Ghica, Antonio De Marinis. You guys rock!

We have implemented a custom facebook integration with a separate PAS plugin. We couldn't use plonesocial.auth.rpx cause we wanted to integrate more deeply with facebook app (more about that later), and that will cost a fortune using rpxnow.com.

We have also added a small disqus trick that notifies archetype object owner that somebody made a comment. We are using the callback method:


function disqus_config() {
    this.callbacks.onNewComment = [function(comment) {
         $.post('%(document_url)s/disqus_notify', {comment: comment});
       }];
  }
 

 

read more

Oct 31, 2011

Plone at PyCon UA

I spent last weekend (22-23 October) in Kiev promoting Plone and Pyramid at PyCon UA. It was an amazing opportunity to spread the latest news about Plone4 and its enhancements.

 

The Kiev event was fruitful experience from two points of view: the audience was not aware of what has been happening in Plone since 3.x; they were mostly Django developers. I think I did my best to explain what are the key values of using Plone and Pyramid together and what are the benefits comparing to other frameworks like Django. I met several fantastic guys deeply interested in what we are doing in both Plone and Pyramid community. Hope to see you all on another Python event.

Apart of Plone talk there were other invited speakers. Let me mention few of them.

Opening talk done by Tarek was about Packaging. He explained current situation of packaging in Python and the future of it. I hope we will have setup.cfg to rull-them-all in near future and that the community will start to use proper versioning soon.

Then there was Armin with Basket of Random Python Snippets. I don't like the idea of showing ONLY code while doing your presentation but I strongly encourage you to read them online. Some of them are really great tips!

Last talk I attended was done by Alexander and I must admit - I have enjoyed it a lot. He was showing "SQLAlchemy: a better ORM". I was never a big fun of Django ORM but now I'm strongly convinced that Pyramid + SQLAlchemy + pyramid_formalchemy is a way much easier to play with.

Bottom line: I must agree with Yury that it would be more interesting event if all of the speakers present slides in English (like on RuPy2011 last October). Nevertheless I enjoy this weekend a lot. I love the city and the atmosphere. The topics and invited speakers were properly chosen so everybody could find a subject to discuss about. Thanks again and hopefully see you next year.

And tomorrow it is time for Plone Conference 2011 which will end this autumn's conference marathon.

Oct 20, 2011

RuPy 2011 - Strongly Dynamic Conference

Last weekend (14-16 Oct 2011) I've attended RuPy (Ruby + Python), a strongly dynamic conference held in Poznań (Poland) and organized by GIK Association. I had a great opportunity to share RedTurtle's "Pyramid and Plone" integration use case with wider audience. It was truly an open source event and a great opportunity to meet geeks from the Ruby community. 

Conference venue It was RuPy's 3rd 4th edition and apart it was the biggest (ca. 300 attendees) I must say - it was the best (I was attending all previous editions). The GIK have chosen Poznań International Fairs as the conference venue which was a damn good idea. During 3 days of the conference there was ca. 30 events (talks, workshops and sprints). Most of them was related to Ruby which is a problem each year. Getting more support from Python community is highly appreciated! 

fancy speaker feedback system What I think is notable is the speaker feedback system. Each room had 3 containers marked: :-) :-| and :-(. After each session the speaker was receiving his anonymous feedback from the audience. From the speaker point of view (so also mine) it's surprisingly easy and gives you great opportunity to check if what you've just said wasn't a completely bullshit. What I would suggest is to make bigger effort in promoting it after each talk.


Interesting talks

my subjective list of notable talks

Programmer Anarchy

by Fred George


Writing your own programming language

by José Valim


Tradeoffs and Choices: Why Ruby Isn't Python

by Yehuda Katz

I didn't find the slides but I hope RuPy team will publish them soon. In the mean time - short abstract:

"When a Pythonista first dives into Ruby, he is confronted with a strange and unusual world. Multiple kinds of functions, implicitness everywhere, violations of the Zen of Python galore! In this talk, Yehuda will talk about the tradeoffs in Ruby's language design: why, in many ways, Ruby couldn't be more like Python even if it wanted to."

Summary

Conference venue It was an amazing weekend with some interesting discussions with people from Python and Ruby world. Thanks RuPy, hope to see you next year!

Last but not least the organization committee followed best practices and shared their website source code to wide public.