What do you think?

We could get some nice charts like here


bryan kennedy’s picture

Status: Active » Postponed (maintainer needs more info)

I need some more information about what you'd like to see for this feature request.

Do you mean:
- 1. Ask the user where they're voting from?
- 2. Auto-detect it from their IP address?
- 3. Auto-detect is from their browser language settings?

If #2, then you're in luck. We already can collect IP addresses for anonymous voters in pollfield. You could use this information to lookup locations, with an external service. However, I don't think writing this lookup code into the core of pollfield is a great idea.

You could write an additional module or view that queried the pollfield data, did the hostname country lookup, and then displayed the graph.

I am a bit hesitant to write it into pollfield, since it adds complexity, and processing time. I am not familiar with how quick the country lookups are, but I am guessing they are slow enough that we wouldn't want to do it dynamically on node load. It might make more sense to do them at a cron job. Anyways, that's just my thoughts. Are you familiar with a good API for doing the geolocation lookups?

I've been thinking about more add-on functionality for pollfield, and how we might implement it without making the core module itself a cludge. Once we get some of the major bugs worked out of the system, it would be nice to have some optional add-on modules that come with the system that can add extra functionality like this. However, I don't think that work is a high priority until we can get a Drupal 7 version of the module developed.

giorgio79’s picture

Priority: Normal » Minor

That is some great stuff Bryan, noticed we can store IP data for users.

Will try to look around for some geoip modules, for low volume stuff there is http://drupal.org/project/geoip

I guess we would need an additional field to store the country with the IP and use charts api to show some nice charts :) Lots of dependencies