def get_esai_user (user_name, user_id): status_weight_factor = 0.5 likes_weight_factor = 0.3 events_weight_factor = 0.2 # calculating status factor status_count_of_user = snaide.get_statuses_count_by (user_name, user_id) total_status_count = snaide.get_all_statuses_count() comment_count_of_user = len ( snaide.get_comments_by(user_name, user_id) ) total_comment_count = snaide.get_all_comments_count() status_factor = (status_count_of_user + comment_count_of_user)/float(total_status_count + total_comment_count) * 100 * status_weight_factor # calculating likes factor total_status_likes_count = snaide.get_all_status_likes_count() status_id_list = snaide.get_statuses_by (user_name, user_id) status_likes_count_user = 0 for status_id in status_id_list: status_likes_count_user = status_likes_count_user + snaide.get_likes_on_single_status(status_id) likes_factor = ( status_likes_count_user/float(total_status_likes_count) ) * 100 * likes_weight_factor #calculating the event factor event_id_list = snaide.get_events_attended_by(user_name , user_id) event_attendees_count = 0 events_factor = 25 for event_id in event_id_list: event_attendees_count = event_attendees_count + snaide.get_event_attendees_count(None, event_id) return status_factor + likes_factor + events_factor
print print snaide.get_all_pages_count() print print snaide.get_all_blogs_count() print print snaide.get_all_groups_count() print print snaide.get_all_status_likes_count() print print snaide.get_all_friends(None, user_guid) print print snaide.get_all_friends_count(None, user_guid) print print snaide.get_comments_by(None, user_guid) print
import snaide v1 = snaide.get_all_users_count() v2 = snaide.get_all_statuses_count() v3 = snaide.get_all_comments_count() v4 = snaide.get_all_status_likes_count() v5 = snaide.get_all_events_count() v6 = snaide.get_all_pages_count() v7 = snaide.get_all_blogs_count() v8 = snaide.get_all_groups_count() #print "total number of users : "+ str(v1) print "average no of status per user posted : " + str(float(v2)/v1) print "average no of comments per each status : " + str(v3/float(v2)) print "average likes for each status : " + str(v4/float(v2)) print "total no of events organized : " + str(v5) print "total no of blogs created : " + str(v7)