Ejemplo n.º 1
0
			checked[user_id] = 1
			friends = plurklib.getFriendsByOffset(user_id, 0, 5000)
			#print '%d friends' % len(friends)
			for friend in friends:
				friend_id = friend['id']
				#print friend_id
				if suspects.has_key(friend_id):
					suspects[friend_id] += 1
				else:
					suspects[friend_id] = 1

	ordered = sorted(((v, k) for (k, v) in suspects.items()), reverse = True)
	output = 0
	for (appearance, suspect) in ordered:
		if plurklib.robots.has_key(suspect):
			#print '(robot) %d' % suspect
			continue
		if not owners.has_key(str(suspect)):
			obj = plurklib.getPublicProfile(suspect)
			owners[str(suspect)] = obj['user_info']
		suspect_info = owners[str(suspect)]
		display_name = suspect_info.get('display_name', suspect_info['nick_name'])
		if display_name is None or display_name == '':
			display_name = suspect_info['nick_name']
		#print ('\t%s (%d:%s)' % (display_name, suspect, suspect_info['nick_name'])).encode('utf-8')
		#print ('\t%s(%d):%d' % (display_name, suspect, appearance)).encode('utf-8')
		print ('\t%s (%d)' % (display_name, appearance)).encode('utf-8')
		output += 1;
		if output > max_output:
			break
Ejemplo n.º 2
0
	owners.update(part_owners)

	offset = part_plurks[len(part_plurks)-1]['posted']
	offset = plurklib.ctime2iso(offset)

# dump
for plurk in plurks:
	owner_id_str = str(plurk['owner_id'])
	owner = owners[owner_id_str]
	display_name = owner.get('display_name', owner['nick_name'])
	print ('%s [%s] %s' % (
		display_name,
		plurk['qualifier'],
		plurk['content_raw'])
		).encode('utf-8')
	limited_to = plurk['limited_to']
	if limited_to == '|0|':
		print '\t(all_friends)'
	else:
		guest_list = limited_to.replace('||', '|').split('|')
		for guest_id in guest_list[1:-1]:
			if not owners.has_key(guest_id):
				obj = plurklib.getPublicProfile(guest_id)
				owners[guest_id] = obj['user_info']
			guest = owners[guest_id]
			display_name = guest.get('display_name', guest['nick_name'])
			if display_name is None or display_name == '':
				display_name = guest['nick_name']
			print '\t' + display_name
Ejemplo n.º 3
0
	owners.update(part_owners)

	offset = part_plurks[len(part_plurks)-1]['posted']
	print 'Last plurk was posted at', offset
	offset = plurklib.ctime2iso(offset)

#search
for plurk in plurks:
	print plurk['plurk_id'], plurk['content_raw'].encode('utf-8')
	obj = plurklib.getResponse(plurk['plurk_id'])
	owners.update(obj['friends'])
	responses = obj['responses']
	for response in responses:
		user_id = response['user_id']
		user_id_str = str(user_id)
		if not owners.has_key(user_id_str):
			obj = plurklib.getPublicProfile(user_id)
			if obj is not None:
				owners.update(obj['user_info'])
		if owners.has_key(user_id_str):
			responser = owners[user_id_str]
			display_name = responser.get('display_name', responser['nick_name'])
			if display_name is None or display_name == '':
				display_name = responser['nick_name']
		else:
			display_name = user_id_str
		print (('\t%s: %s') % (display_name, response['content_raw'])).encode('utf-8')
		if responser['nick_name'] == 'iKKBOX':
			print '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'