Help - Search - Members - Calendar
Full Version: SearchForUsers
Skype Community > English > Development, Betas and Skype Garage > Skype Public API
Nik_pc
Hi all,
why sometimes the SearchForUsers function return a series of "Wait timeout" error?
TheUberOverlord
QUOTE (Nik_pc @ Sun Jun 22 2008, 16:40)
Go to the original post
Hi all,
why sometimes the SearchForUsers function return a series of "Wait timeout" error?


Please show example.
Nik_pc
QUOTE (TheUberOverlord @ Sun Jun 22 2008, 23:43)
Go to the original post
Please show example.


procedure TForm1.Button1Click(Sender: TObject);
var
i, how_many_times: integer;
filter, user: string;
pUsers: IUserCollection;
clock: TDateTime;
begin
// suppose this variable setup by the user with a field edit
how_many_times := 10;
try
for i := 1 to how_many_times do begin
filter := Chr((Random(26)+97)); // any random char between 'a..z'
pUsers := Skype.SearchForUsers(filter);
if pUsers.Count > 0 then begin
// skip the users already Friends
if pUsers.Item[i].BuddyStatus = budFriend then
continue;
user := pUSers[i].Handle;
// if the user is not in the ListBox...
if (ListBoxUsers.Items.IndexOf(user) = -1) then
ListBoxUsers.Items.Add(user); // add it!
clock := Now;
// wait 10 seconds before continue
while (Now - clock) < 0.0001 do begin
end;
end;
end;
except
on E:Exception do
ShowMessage('Error: '+E.message);
end;
end;
TheUberOverlord
Why are you doing this?

When too may searches are pending this can happen. How many searches is this "BOT" trying to do at a time when it fails?
Nik_pc
QUOTE (TheUberOverlord @ Mon Jun 23 2008, 22:55)
Go to the original post
Why are you doing this?

When too may searches are pending this can happen. How many searches is this "BOT" trying to do at a time when it fails?


For example, I saw that the search functionality of Skype doesn't find all the users from Italy at the same time, and I have to click the Search button many times. Thus, I want to develop a little tool that makes a series of consecutive searchs without human intervention.

I make only one search at a time, waiting for 10 seconds before starts the next one. I can understand the error if I use the AsyncSearchUsers, but I use the SearchForUsers.
It's random when the error comes. Sometimes after three search, sometimes after ten.
TheUberOverlord
QUOTE (Nik_pc @ Tue Jun 24 2008, 12:03)
Go to the original post
For example, I saw that the search functionality of Skype doesn't find all the users from Italy at the same time, and I have to click the Search button many times. Thus, I want to develop a little tool that makes a series of consecutive searchs without human intervention.

I make only one search at a time, waiting for 10 seconds before starts the next one. I can understand the error if I use the AsyncSearchUsers, but I use the SearchForUsers.
It's random when the error comes. Sometimes after three search, sometimes after ten.


Do you realize that you can only search by name using the API/Skype4COM, not country? So you are getting "All" users worldwide for you search selection.

Did you read my response to your post here and review the link I provided?

http://forum.skype.com/index.php?showtopic=152681

My point being, that you will need to search hundreds of "Millions"of Skype users before you create a list of all Skype users located in Italy.

The API/Skype4COM SearchForUsers method was not intended to be used in extended loops trying to locate serch criteria outside the scope of a Skype users name.
Nik_pc
Sure I read your post, and I understand that is not possible to search for users in SkypeMe mode.
The code I post here is only a sample. My original has several filters to exclude all of the users that I don't want. It's the only manner I have using Skype4COM for search for italian users and/or other search criteria, all filtered in my application.

I'm trying to do that because I think the search functionality in Skype is not so good (is impossible that it found only a few users in SkypeMe, and ever the same!!), but I understand that maybe the SearchForUsers function is not so complex and complete for what I want to do.

I think that I stop my develop waiting for a next release of Skype4COM, hoping to find what I'm searchin for :-)

Thank you!!

TheUberOverlord
QUOTE (Nik_pc @ Tue Jun 24 2008, 13:19)
Go to the original post
Sure I read your post, and I understand that is not possible to search for users in SkypeMe mode.
The code I post here is only a sample. My original has several filters to exclude all of the users that I don't want. It's the only manner I have using Skype4COM for search for italian users and/or other search criteria, all filtered in my application.

I'm trying to do that because I think the search functionality in Skype is not so good (is impossible that it found only a few users in SkypeMe, and ever the same!!), but I understand that maybe the SearchForUsers function is not so complex and complete for what I want to do.

I think that I stop my develop waiting for a next release of Skype4COM, hoping to find what I'm searchin for :-)

Thank you!!


The SearchForUser is only for searching of the Skype user names, not what mode they are in, where they live, what sex they are, how old they are.

You can't make SearchForUsers do something it is not intended to do, so this was and is my point. This search ability is also not for country or user mode.

This is WHY I asked if you looked at the link I provided in the first post I responded to about this, because this explains what the search performs.

I will provide the link here again:

https://developer.skype.com/Docs/ApiDoc/SEARCH_USERS

As you can see, not only does it not provide a search of users in SkypeMe mode, it also does not provide a search of users located in a specific country.

You say "My original has several filters to exclude all of the users that I don't want."

You would require "Millons" of user names to be returned using your "filters", if you search for users that start with "a" you will get many results wink.png

Your Example Code:

CODE
filter := Chr((Random(26)+97)); // any random char between 'a..z'
pUsers := Skype.SearchForUsers(filter);


Cute, but still just short of an infinite loop tongueout.png
Nik_pc
Yes, you right, but any search with my code return not more than 180-190 users each time, then I loop into they excluding those that I don't want using filters like this:

if pUsers.Item[i].BuddyStatus = budFriend then
continue;

The IUserCollection has all the properties in wich looking for exclusions/inclusions, looking at the "pUsers" filled by the SearchForUsers. The only one property not working is the OnlineStatus, not working for Skype policies as I read somewhere.

Anyway, there are millions of users, but the search return more or less the same ones each time, so maybe there something wrong in my code or overwhere.
TheUberOverlord
QUOTE (Nik_pc @ Tue Jun 24 2008, 17:05)
Go to the original post
Yes, you right, but any search with my code return not more than 180-190 users each time, then I loop into they excluding those that I don't want using filters like this:

if pUsers.Item[i].BuddyStatus = budFriend then
continue;

The IUserCollection has all the properties in wich looking for exclusions/inclusions, looking at the "pUsers" filled by the SearchForUsers. The only one property not working is the OnlineStatus, not working for Skype policies as I read somewhere.

Anyway, there are millions of users, but the search return more or less the same ones each time, so maybe there something wrong in my code or overwhere.


190 * 26("a-z") = 4,940 User lookups ("Each Time") for what? This is why the search is restricted, because of possible abuses. Like this, what will you do with this ask 4,940 Skype users to add you to their contact list?

Do you get my point, what is positive about this "BOT"? What purpose is it serving for you?

Initially in your first post http://forum.skype.com/index.php?showtopic=152681 ("You claim") you want to look up Skype users who are in SkypeMe mode. In this post, ("You Claim") you want to find people in Italy.

For every 4,940 Users you search for, using this "filter" how many are in SkypeMe mode or Live in Italy? Very very few I would imagine, so why continue to use the resources you are trying to with your code?

Why not code something useful that does not consume so much overhead?

If you just want to find friends by Skype users in SkypeMe mode, located in Italy, you would find them much much faster by using the Skype client manually and also not putting a load on the Skype servers requesting thousands of User lookups at one time via some BOT program, where most of the users returned are not even needed or wanted by you.
Nik_pc
How I've already said, I've stopped my develop.
Is not a good idea search users in this manner, because of limitations of the SearchForUsers function and, most of all, because is not in my intentions create a BOT and consume so much overhead.
I wanted to improve the search functionality in Skype, but this is not the right way. Patience, I can think about my code that was a good task to improve my personal skill in Delphi programming.

:-)
TheUberOverlord
QUOTE (Nik_pc @ Wed Jun 25 2008, 14:44)
Go to the original post
How I've already said, I've stopped my develop.
Is not a good idea search users in this manner, because of limitations of the SearchForUsers function and, most of all, because is not in my intentions create a BOT and consume so much overhead.
I wanted to improve the search functionality in Skype, but this is not the right way. Patience, I can think about my code that was a good task to improve my personal skill in Delphi programming.

:-)


Well, I hope you do NOT stop ALL development on Skype, just this search.

By The way, I spent 2 years in Italy, while I was in the Air Force, in Martina Franca, Near Bari. Italy is very beautiful.


Nik_pc
QUOTE (TheUberOverlord @ Thu Jun 26 2008, 00:17)
Go to the original post
Well, I hope you do NOT stop ALL development on Skype, just this search.

By The way, I spent 2 years in Italy, while I was in the Air Force, in Martina Franca, Near Bari. Italy is very beautiful.


Modestly, Italy is the best place in the world :-)

Anyway, I don't stop all of my develop on Skype. I'm thinking about create something like a sort of AI, maybe for use of helpdesks.

Nik
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.