April 27, 2008, 6:04 pm
I was reading reddit the other day and stumbled upon the fact that wikipedia has an API. Neat I thought, and having some free time since my exams are now over I figured I would play around a bit with it. When I browse wikipedia I often click from link to link, and have come to the conclusion that all articles are 6 degrees of separation. For example I can go from Ubuntu to Tesco to Japan to G8 to United States to George W. Bush bet you never knew Ubuntu was connected to George W. Bush. I once wrote a map of the internet program that people seemed to like to download and modify so in that spirit I wrote wikimap.py to map wikipedia. wikimap.py Requires pygraphviz (Install using sudo aptitude install python-pygraphviz). To use the program simply run the program and give it the wiki page name for example “python wikimap.py Norman_Graham” Note that Ubuntu is Ubuntu_(Linux_distribution) and you can find the full name in the address bar of your browser. For more complicated maps use wikimap.py –help for full usage info.
Here are a few examples that I created with wikimap.py


And a really large one being viewed in inkscape.

More examples including the dot files can be found at http://www.files.earobinson.org/wiki/. But there are a few features I would like to add:
- Generating the graph using python-pygraphviz currently takes a really long time and I would like to be able to do it faster
- Page links currently include templates, I would like to only use links in the body of the text
- It would be nice if the software cached previously seen connections. (But then I need to detect updates to that page)
If anyone has a nice simple soultion to any of those problems leave a comment. Also if you are able to generate any neat images I would love to see them.
Tags:
api,
graphviz,
internet,
Linux,
map,
Programing,
Python,
sandbox,
Ubuntu,
wikipedia,
wikis Category:
Projects,
Python |
12 Comments
April 10, 2008, 4:29 pm
I know that this has been done before but it seems to go around every once in a while and I always have fun reading them. So once again here are my top 10 commands.
My Computer
[sourcecode language="python"]earobinson@MinusOne:~$ history|awk ‘{a[$2]++ } END{for(i in a){print a[i] ” ” i}}’|sort -rn|head
143 cd
114 ls
53 make
48 svn
34 svnup
18 sh
12 cat
11 rm
11 geany
9 touch
earobinson@MinusOne:~$ alias svnup
alias svnup=’. /media/data/dev/scripts/svnup/svnup.sh’
[/sourcecode]
Laptop
[sourcecode language="python"]earobinson@NaN:~$ history|awk ‘{a[$2]++ } END{for(i in a){print a[i] ” ” i}}’|sort -rn|head
138 make
82 ls
70 cd
41 cmake
33 svn
19 svnup
18 cat
16 man
12 ./A/runA
10 geany
earobinson@NaN:~$ alias svnup
alias svnup=’. /media/data/dev/scripts/svnup/svnup.sh’
[/sourcecode]
Girlfriends Computer
[sourcecode language="python"]earobinson@Null:~$ history|awk ‘{a[$2]++ } END{for(i in a){print a[i] ” ” i}}’|sort -rn|head
49 espeak
7 sudo
1 vi
1 top
1 ssh
1 man
1 ls
1 history|awk
1 history
1 exit
earobinson@Null:~$ espeak “love ya baby”
[/sourcecode]
April 9, 2008, 12:33 pm
I’m currently working on a cross platform project. The code is C++ and I’m going to be doing most of my development on the linux side but I need all of my compile scripts to be able to work on windows. After doing some googling and talking to people cmake seems to be what I’m going to go with.
My problem is that the documentation sucks. In fact even the example on the site did not work when I tried to download it (Update: Thanks for fixing this Bill). I was able to download the file but it seemed to be an empty tar.gz file.
So with a bit more googling I was able to create my own example. I know the KDE guys switched to cmake but thats about it. Anyone have any experience with cmake? How did it work out for you? Any better recommendations? Better sites for documentation?