Friday, September 16, 2011

Kuliza@Mysore Day 1

We want to implelemt a working prototype of a sharing/analytics widget like easyshare, within 7 days. The widget is targetted at e-commerce platforms.


Problem :

Person 1 shares a link through our widget on facebook.
Person 2 shares the same link through our widget on facebook.
Person 3 reshares the same link on facebook by seeing Person 1's shared link.
Person 4,5 and 6 reshare the same link on facebook by seeing Person 2's shared link.
Person 7,8,9 and 10 see Person 3's link and reshare it.

We need to find who was the most influential person among each one who shared.


Tree models :
1 --- 3 --- (7,8,9,10)
2 --- (4,5,6)
As we can see here, Person 3 is the most influential here.


Solution :

Consider Person 1 and 2 as the root users. When a root user shares our link on facebook, we store the following in the backend :
1. Our system generated userid
2. Facebook id of the person
3. URL shared
4. parent Id : null

Then we append a query parameter to the URL which is the facebook User Id of the root user and shotren it using bit.ly, and then this link is shared.

eg. Person 1 shares http:www.hostname/productpage
we store Person 1's facebook userId and the URL http:www.hostname/productpage in the backend.

Now we append the url with a query parameter and shorten the url using bitly.

http:www.hostname/productpage/?q=userid
bit.ly/Li32df34

Then we share this link on facebook.

When a new person Re-shares the same link on facebook using the link provided by person 1:

Store the following in the database :
1. Our system generated userid
2. Facebook id of the new person
3. URL shared (got through the parent)
4. parent Id : id retrieved from the query parameter.

In this way, we can track the most influential user by querying to get the id which appears maximum time in the parentid.

Using bitly APIs, we can track the number of hits for a particular URL and hence find out the most influencial person.
Powered By Blogger
Custom Search