Find user by name

45 views
Skip to first unread message

Mike

unread,
Mar 5, 2012, 6:50:52 PM3/5/12
to WallaBee Developers
What's the best way to find a user by name?

Mobijack

unread,
Mar 5, 2012, 7:06:11 PM3/5/12
to WallaBee Developers
Hi Mike,

I've been using the API, and I believe it's only currently possible to
efficiently query a user if you know the user's ID.

You 'could' iterate through every user ID, but this isn't efficient,
and you'll need to implement a queue so that you don't hit rate
limiting issues. This isn't a viable option in the long term, as the
user base will increase over time, lengthening the time of your
search.

I'm guessing this is a call that will come to the public API sometime
in the future (but I'd look to the development team to advise if and
when this might be).

Regards,

Jonathan
@mobijack

Mike Antosh

unread,
Mar 5, 2012, 7:43:24 PM3/5/12
to wallabee-...@googlegroups.com
That's sort of what I thought. Didn't know if I was missing something. Thanks.

Ben Dodson

unread,
Mar 6, 2012, 5:33:06 AM3/6/12
to wallabee-...@googlegroups.com
Hey Mike,

At the moment the API doesn't have a user search option as we assumed that any actions you'd need to take would be by users you already knew i.e. if you wanted to compare sets with my friends, you'd get the user/my-id/friends API call to get information on each of my friends. You can find user ids in many API calls (i.e. if you're looking at an item you'll see the user ids for each person that has interacted with it).

If you let me know the kind of thing you are working on then I can add something to the API to help you out as at the moment there aren't any new users API calls in the pipeline.

Cheers,

Ben


On Monday, March 5, 2012 11:50:52 PM UTC, Mike wrote:
What's the best way to find a user by name?

On Monday, March 5, 2012 11:50:52 PM UTC, Mike wrote:
What's the best way to find a user by name?

Mobijack

unread,
Mar 6, 2012, 6:24:06 AM3/6/12
to WallaBee Developers
Hi,

I'm guessing the first problem is figuring out what 'my user ID' is.

This of course will be resolved in the future when OAuth is available.

One quick way to find your user id is to use the lat and lng of
somewhere you've foraged to find nearby places. Use the place id of
one of the places you've been to look at the people who've visited
there. You'll be one of those people, giving you your user id.

Regards,

Jonathan
@mobijack

Mike Antosh

unread,
Mar 6, 2012, 11:00:42 AM3/6/12
to wallabee-...@googlegroups.com
Right, figuring out my user ID was the problem.  I wrote a script to list the items a user is missing.  To find my id I scrolled through Ben's friends till I found my user name using the API explorer.  Then I could find my wife's ID by looking at my friends.  An API call like http://api.wallab.ee/users/<NAME> would eliminate the manual searching.

I also have a script that show's details about item types.  I have to manually find the itemtype_id for that as well.  Those are easier to find since I can query all the sets, find the ID for the set I'm interested in, and then find the items in the set.
--
Mike

Ben Dodson

unread,
Mar 6, 2012, 6:36:54 PM3/6/12
to wallabee-...@googlegroups.com
Hi Guys,

This is actually quite a glaring omission so my apologies for this. At some point we'll add a proper user "search" but in the mean time I've made the following implementation; instead of providing a user id, you can provide a user name. This is an unofficial feature as there are several situations when this won't work (i.e. if a user chooses the user name "123" then it will show the user with id "123" rather than a user with that name) so it won't be added to the official documentation. However, this should be sufficient for getting your code working now :)

Please remember to url encode any names as otherwise it won't work. Here are some examples:


Let me know if you run into any problems.

Ben

Mobijack

unread,
Mar 6, 2012, 6:45:46 PM3/6/12
to WallaBee Developers
Hi Ben,

Although unofficial... this is a nice touch; and thanks for the fast
turnaround.

To get around the issue you described i.e. users with names such as
123, you could enforce user names to include at least one alpha
character (but I'm guessing you can't retrospectively implement this
if users have already chosen such names).

Thanks,

Jonathan
@mobijack

On Mar 6, 11:36 pm, Ben Dodson <b...@bendodson.com> wrote:
> Hi Guys,
>
> This is actually quite a glaring omission so my apologies for this. At some
> point we'll add a proper user "search" but in the mean time I've made the
> following implementation; instead of providing a user id, you can provide a
> user name. This is an unofficial feature as there are several situations
> when this won't work (i.e. if a user chooses the user name "123" then it
> will show the user with id "123" rather than a user with that name) so it
> won't be added to the official documentation. However, this should be
> sufficient for getting your code working now :)
>
> Please remember to url encode any names as otherwise it won't work. Here
> are some examples:
>
> http://api.wallab.ee/users/1=http://api.wallab.ee/users/bendodsonhttp://api.wallab.ee/users/2/pouch
> =http://api.wallab.ee/users/simon%20wicks/pouch

Mike Antosh

unread,
Mar 6, 2012, 6:53:43 PM3/6/12
to wallabee-...@googlegroups.com
Thanks, that's just what I was looking for. I haven't thought of any place I'd need search functionality so no need to implement that for me. 

Ben Dodson

unread,
Mar 6, 2012, 6:55:13 PM3/6/12
to wallabee-...@googlegroups.com
At some point I'll add an endpoint so you can give it a username and it will just return the user id rather than hacking the existing "id" only function. This should hopefully tide everyone over in the meantime :)

Ben

Chris Harrison

unread,
Mar 20, 2012, 3:13:00 PM3/20/12
to wallabee-...@googlegroups.com
This by no means complete, but we' have a basic profile viewer on ItemBrowser: http://itembrowser.com/profile.php
You can view users by ID (if known) or username: http://itembrowser.com/profile.php?id=cd or http://itembrowser.com/profile.php?id=262
 

Chris Harrison

unread,
Mar 20, 2012, 3:13:57 PM3/20/12
to wallabee-...@googlegroups.com
Ignore the mySQL error ;) We're implementing caching and this part isn't part of that work, yet.
Reply all
Reply to author
Forward
0 new messages