ptwobrussell / Mining-the-Social-Web

The official online compendium for Mining the Social Web (O'Reilly, 2011)
http://bit.ly/135dHfs
Other
1.21k stars 491 forks source link

Error of Redis MGET #72

Open zhengyanglu opened 10 years ago

zhengyanglu commented 10 years ago

In the friends_followers__calculate_avg_influence_of_followers.py, there is: followers = r.mget([getRedisIdByUserId(follower_id, 'info.json') for follower_id in follower_ids]).

However, when I run the script, it gave me "wrong number of arguments for 'mget' command".

ptwobrussell commented 10 years ago

Can you tell me the version of Redis that you are running? Most likely, you're using a newer version in which the API has changed. I'm happy to help you work through this problem, but could I also recommend checking out Mining-the-Social-Web-2nd-Edition that's available at https://github.com/ptwobrussell/Mining-the-Social-Web-2nd-Edition ?

Some screencasts are available that are designed to help you get started - https://vimeo.com/channels/MiningTheSocialWeb - and I think you'll find that it's a considerably better project and a much simpler codebase and set of technologies to work with if you are interested in the social web mining space.

zhengyanglu commented 10 years ago

Hi, I have the latest Redis installed which is Redis 2.6.16.

ptwobrussell commented 10 years ago

It appears as though the MGET command is the same in 2.6 as it has always been since 1.0. My recommendation would be to add some logging that prints out some values to see what is being returned and passed into r.mget like this:

import sys

print >> sys.stderr, follower_ids

for follower_id in follower_ids:
    print >> sys.stderr, getRedisIdByUserId(follower_id, 'info.json')

Let me know what that returns, and we can work from there.