Bash script to find mutual friends in twitter

My manager gave me a simple(tough for me) assignment to learn..

Problem: Write a command line app using your favourite language that accepts 2 facebook ids and return a list of common friends between the 2 ids.

I couldn't! I could make a program that list my friends but not others because it's private information and it requires others to allow my application blah blah..

So I gave a try for twitter and I SUCCESSFULLY DID IT! ;) Because following and followers list are public in twitter.

Check out the script and screenshot

Script

#!/bin/bash

link1='https://api.twitter.com/1/friends/ids.json?screen_name='$1

link2='https://api.twitter.com/1/friends/ids.json?screen_name='$2

curl $link1 > .fol.tmp

curl $link2 > .fol2.tmp

cat .fol.tmp | sed 's/.*\[\([0-9,]*\)\].*/\1/' | sed 's/,/\n/g' | sort > .ids.tmp

cat .fol2.tmp | sed 's/.*\[\([0-9,]*\)\].*/\1/' | sed 's/,/\n/g' | sort > .ids2.tmp

#comm -12 .ids.tmp .ids2.tmp | tr '\n' ',' | sed 's/,$//' > .comids.tmp

#comm -12 is same as grep -xFf :)

grep -xFf .ids.tmp .ids2.tmp | tr '\n' ',' | sed 's/,$//' > .comids.tmp

comids=`cat .comids.tmp`

comidlink='https://api.twitter.com/1/users/lookup.json?user_id='$comids

curl $comidlink > .lookup.tmp

cat .lookup.tmp | tr ',' '\n' | grep '"name"' | sed 's/.*:\"\([^\"]*\)\"/\1/g'

rm .fol.tmp .fol2.tmp .ids.tmp .ids2.tmp .comids.tmp .lookup.tmp

Note: I'm an amateur programmer. This code may not be the most efficient but it does the job well.

Screenshot:

Mutualfriends2

Posted via email from Art, Science & Technology

Neembuu Uploader crossed 10k+ downloads and featured in a Japanese Magazine

Hi y'all,

I hadn't been updating on NU for a long time after getting job. Though I am sincerely committed to my employers, I will still be responsible to my previous projects that helped me improve in life. I will use my weekends on them. Shashaank (Neembuu Admin) has a lots of plans for Neembuu, Neembuu Uploader, JPFM, JD and Vuze all combined. Lots of works ahead ;-)

NU Stats:

Downloads: 10325 (at the time of writing this)
Top Country: France :)
You can always see the latest stats at http://neembuuuploader.sf.net/downloads.html

France overtook Russia as the top downloading country. Seems like we have a lot of fans there.

AND I am very happy now to announce that Neembuu Uploader has been featured in a Japanese Tech magazine called "iP!". A month ago I got this mail from them:

Dear Vigneshwaran Raveendran,

I am an editor of a Japanese magazine called "iP!", a magazine for
Windows users with original DVD-ROMs to offer data/software.
I would like to introduce your "Neembuu Uploader"to Japanese Windows users.
And I am glad that you would give me kind permission to put your soft
into our DVD-ROM.
If OK,I would like to introduce "Neembuu Uploader" continuously from now on.

Please let me  know when you have any questions or find any problems
for introducing your soft.
I'm looking forward to hearing from you soon.

Published information is the following.
Please correct it when the mistake is found.
<snipped> 

And I replied:

Dear Xxxxxxx Xxx,

I am really glad to know that my product "Neembuu Uploader" will be introduced in 
your magazine. You are ALLOWED to feature it in your magazine. Please make sure
that you include my name "Vigneshwaran Raveendran" and the homepage url 
http://neembuuuploader.sourceforge.net/ anywhere in the body of the content.

I have one request. I am living in India where I cannot get access to your "iP!" magazine.
So after the magazine is published, please send me a scanned image of the page where
"Neembuu Uploader" is featured.

Thank you

After a long time, yesterday they replied:

Vigneshwaran Raveendran様

お世話になっております。晋遊舎の静内です。
このたびはソフトウエアの掲載に
ご協力ありがとうございました。

無事に誌面が完成いたしましたのでお送りいたします。
引き続きまして、変わらぬご愛顧のほど、
どうぞよろしくお願い申し上げます。

(Translate if you don't know japanese)

They attached a pdf of the scanned magazine. I took this screenshot of the part where NU appears. Check it out:

28

Posted via email from Art, Science & Technology