Cleaning Flickr Tags

November 2nd, 2008

As part of an application I’m developing, I needed to store tags from multiple sources, and I chose to use Flickr’s method of storing raw and clean tags. I needed to figure out how Flickr converts raw tags to clean ones. This article by Terrell Russell helped a lot, but missed a few elements (and I needed it in Java).

The original regular expression by Russell did not include a comma, and I also found out certain special characters are substituted (I guess I will find more of them as I keep comparing Flickr tags).

public static String cleanRawTag(String raw, boolean isMachineTag)
{
    	if(isMachineTag)
    	{
    		// raw  = geo:lat=13.751193
    		// name = geo:lat=13751193
    		int equals = raw.indexOf('=');
    		return raw.substring(0, equals+1).toLowerCase() + cleanRawTag(raw.substring(equals+1), false);
    	}
    	else
    	{
    		String clean = raw.replaceAll("[s"!@#$%^&*():,-_+='/.;`<>[]?\]", "").toLowerCase();
    		return clean.replace('ß', 's').replace('ς', 'σ');
    	}
}

OFEQ7 over Iran

September 6th, 2008

Satellites have always fascinated me, especially the top-secret military spy satellites that watch us from above. Google Earth, which lets you fly anywhere on Earth to view satellite imagery is one of those rare opportunities to grasp how small our world is. All the drama, politics, internets, families, friends and enemies – all of it, lays on this blue sphere. I can’t wait for the day Google Earth will display real-time imagery of our world…

OFEQ7 over Iran

“What many people don’t know is that USSTRATCOM tracks and publishes a list of over 13,000 objects that they currently monitor. This data is meaningless to most people, but thanks to Analytical Graphics, it has now been made accessible free of charge to anyone with a copy of Google Earth. By grabbing the KMZ, you can not only view all objects tracked in real-time, but you can also click on them to get more information on the specific satellite, including viewing its orbit trajectory. It’s an excellent educational tool for the space-curious.” [Slashdot]

I had to wait for quite some time until I caught OFEQ over Iran though…

By the way, if you haven’t already, check out the 3D buildings in Tel-Aviv, created by Metroscape, and a new BBC series which makes use of satellite technology and data acquired from various other sources to create stunning images of Britain from Above.

twitter for kudos

June 26th, 2008

The thing I like most about twitter is how it makes people you don’t know more approachable, and I especially mean celebrities and gurus. I would never have had the guts to write @chrisblizzard an email, thinking it would probably disturb him. However, my twit about how I think whoisi.com is pure genius probably hit right the spot I meant – make him smile for two seconds.

qYOUARE

June 10th, 2008

qYOUARE is a small thingy that lets you easily create QR Codes.

When scanned, each qYOUARE links to a specific page, where you can share some information and even have a discussion with whoever scanned the code.

qYOUAREs can be printed on stickers, t-shirts, mugs and can even be sprayed on walls. You can place them anywhere thinkable in the physical world – providing a cool and geeky bridge back to the online world.

http://qyouare.com/about/Creating the website was a learning experience for me, as I have never coded anything larger than a page or two for the Web. Since I always find it easier to develop after going over some sample code, I figured the best way to share my experience would be to make the entire source code behind the web site available for download.

In order to create a new qYOUARE, browse to http://qyouare.com/[your desired code] (I know, the GUI still sucks…)

Official Gayglers in the Tel-Aviv Gay Pride Parade

June 6th, 2008
gayglers

Israeli Gayglers searching for “equal rights, justice, toleration… and a husband” :)

From the Official Google Blog:

This summer marked the first time Gayglers coordinated a presence at Pride parades globally. In San Francisco, New York, and Dublin, we had the largest (and perhaps rowdiest) presence of any corporation, and we went one further at Europride in Madrid where we were the only global company present among 45 floats. We had lot of fun at all of the marches, and it was a great way to bring Gayglers and their friends together in the communities we call home. We’re passionate about our diverse workplace, and we hope anyone who shares our commitment to equality will consider joining us.

» more photos from the parade

Israel Safran

May 23rd, 2008

Three years ago today, a great man left us. My leader and mentor, Israel Safran. How fast time flies.
I miss you every day since you’ve left, and think about you a lot, especially on how things would be different if you were still alive.

Growing Pains

May 20th, 2008

First, Hello World.

My online nick has always been antichrist. It was set before they brought the internets to Israel, when all we had was teenage rage, quasi-satanic music and the A-List.antichrist fishbone cell

Over the years, I had a few mishaps surrounding this controversial choice I made, but most of the times I sticked with antichrist. I almost got banned from the Hebrew Wikipedia due to my offensive username (funny thing is, the English Wikipedia doesn’t really care) – so I had to ask the Hebrew Wikipedia god to change it to my favorite alternative, carnivore. Wikimedia supports changing usernames, and there was no problem setting up a redirect page from the old user page to the new.

Another incident occurred after sending a link to some marvelous photos on my Flickr page to coworkers in the USA on Christmas eve. All they had to say was how offended they were with receiving a satanic email on Jesus’s birthday. In later emails I used my Flickr ID instead of my Flickr URL when sending links to sissies.

About a week ago, though, Yaniv Golan told me I have to establish my Internet presence, and not as antichrist. He didn’t say that, but I felt he meant I need to grow up, in a way.

I thought about it, and decided to go with nivsin from now on, especially since it includes the word sin. So I didn’t entirely grow up.

One of my most important places on the Web is del.icio.us. I love del.icio.us. It’s one of the best inventions ever made in the online world. It’s a crowdsourced live catalog of the Web, sometimes even more effective than Google’s search engine. But it does not support changing usernames.

From the FAQ under “How do I change my username?

There’s no easy way to do this right now, but you can use the export and import features in your settings to change to a new account while preserving your current bookmarks. First, visit your settings (accessible from the top right of every page on del.icio.us) and select export (backup) from that page. Follow the directions to export your bookmarks. Then, register or log into your new account, go to settings, and select import (upload). After importing your bookmarks into your new account, you can log out of it and log back into your old account to delete that one. To do this, go to settings and choose delete account.

No easy way? But it’s possible, right? I wanted to change del.icio.us/antichrist to del.icio.us/nivsin. And I wanted it now. It was one of the most difficult and frustrating things I have ever did.

I exported my 5,914 bookmarks into an HTML file (the format IE and Firefox use to store exported bookmarks). And noticed the warning:

Note: If you choose the option to include your tags, they will be in your export even if you don’t see them on the page — you can view the source of the file to make sure your tags are there. Also note that if you have created tag bundles, they will not be preserved in your exported file. This is a limitation of the export file format.

I can re-create the bundles using copy-paste, and as long as my tags are preserved, no problem. Or so I thought. Social tags like for:username are imported as for_username. There is no automatic way to restore them to the original tag. And the worst thing of all:

Bookmarks you import will be kept private. We encourage you to share them after importing; that way, everyone can benefit.

I thought to myself, naïvely, well there’s a new del.icio.us firefox addon – it probably supports bulk operations, because I don’t want to leave all my bookmarks private. Hey, but I do want to keep my private bookmarks private… can I filter my private bookmarks? No. Del.icio.us has system: tags, for file types and more, which is great, but there are no Gmail like is:private tags.

I found a Greasemonkey userscript that enables sharing or deleting all bookmarks (on a page, up to 100 in bulk). So how hard could it be? Still naïve.

I have 60 pages of bookmarks. The plan was to go over them, find the private bookmarks, and tag them with a special tag. Then run the bulk share 60 times on the new account, and the bulk delete 60 times on the old account (I am too afraid to delete the old account completely…). Then go over the private bookmarks and unshare them. I also need to take care of re-adding all my friends to my new account’s network, recreate the tag bundles and manually rename all the for_username tags to for:username tags. A solid plan.

But wait, why is there a delay button on the bulker thingy? I found out soon enough. After doing something like 2 pages – all you get from del.icio.us is the dreaded Yahoo 999 error. Since I was doing it from home, I reset my ADSL modem every time it happened, to get a new IP address. It worked for a while, but it got really late and I had to go to sleep. I planned to continue running it from the office, with a longer delay – because we have a static IP address… but not long after, 999 again. For hours. No one from the office has access to del.icio.us, and they all blame me. me. At least it gives me some hacker hype credit whenever something like this happens.

Proxy? Worked. For about 3 more pages. Then a thought came to mind. How about I set up a web-proxy on Amazon EC2, and whenever I get banned, I’ll just terminate the instance and start a new one? Cool. 10 cents for a couple of pages… expensive, inefficient, but adventurous. There is an excellent article on how to start squid on EC2 here – it takes less than 2 minutes to start an instance running squid. You even use the default squid configuration, and I used PuTTY for tunneling the connection.

It would have been so much easier if they allowed me to change my username and just forward visitors to the new URL. Or if I continued not caring and kept my online offensive presence as-is…

EC2 Proxy Worked. For 7 more pages. Then any instance I started was already banned. I am currently sharing page 56/60, and have 44 more pages to delete. If you’re quick enough, you may try to grab my private bookmarks before I manage to re-unshare them. But I’m not worried, you’ll probably get temporarily banned by Yahoo! before you figure out which tag I used.

Lastly, I apologize to my del.icio.us contacts about all the for: links that might reappear…