So, after making a python script for fetching bookmarks from the exported HTML files, I was wondering how to make it work automatically so that I don’t need to give the HTML file every time. I started looking in firefox directory for some bookmark files which I could use. I found out that firefox keeps bookmark backups and they are encoded in json. I learned few things about json and started to write the script. Importing Modules
Priyans Murarka was having troubles managing his bookmarks. He wanted to keep all the bookmarks from all the browsers from all the OSes in one place. So, I suggested him to use rowz . It’s a really good website to keep your bookmarks at one place and also you can view others’ bookmarks also. Recently, they added a new feature, using which one could import the bookmarks from the browser. What they do is they ask you to export your bookmarks in an HTML file and upload it on the site. So, I see an HTML file, and all I can think of is BeautifulSoup. So, I open the HTML file. And.. OK! it’s damn easy! Importing Modules
from BeautifulSoup import BeautifulSoup
Tags: Python, IMDB, BeautifulSoup, Proxy, Browser, Mechanize, Movie, Parsing IMDB-py Gist <UPDATE>I have added a new and a bit better python script to fetch movie details from IMDB has been updated on my gits. visit imdb gist or go to … Continue reading →
Gmail GUI Gmail API This is a program written in Python using which you can send an email with multiple attachments(any kind) to multiple recipients. I have used libraries like smtplib, email, MIME, etc. The code proceeds by making an … Continue reading →
So here’s a small script which will monitor the amount of your browsing/downloading data.
I have used pypcap and dpkt library. dpkt is a library which provides packets creation/ parsing capabilities with an object oriented interface. The project is hosted at http://code.google.com/p/dpkt/ .
import pcap, dpkt, socket
pc = pcap.pcap()
ports = (80, 8080, 443, 888) # for HTPP and HTPPS
pc is now my pcap.pcap object. pcap objects are their own iterator returning the timestamp and
the packet as a 2-tuple.
mem = sport = dport = 0
for ts, pkt in pc:
eth = dpkt.ethernet.Ethernet(pkt)
ip = eth.data
So a few weeks ago, I got interested in python. I have been hearing about python for last one year or so, but it never amazed me much. I would always dismiss it thinking I’m a C guy and python … Continue reading →