Save requested geolocation in rails with geocoder to DB - ruby-on-rails

I'm working at a social network project in rails and we need to show a "map of dreams".
Technically, we want to display all our user geolocation (for security reasons, without much preciseness) at map as "dreams map" in our city).
I'm using devise for users administration and I already installed geocoder gem.
I want to know how could I save the requested (HTML5 geolocation service/functionality, I guess...) to database and display it at a map.
I've been trying a few days ago but I can only show the location if users fill their country/city fields. Note.: Our app doesn't has a Users controller.
UPDATE:
I'm getting only the reference to the entire city with IP address request from the last_sign_in_ip column. I've read that request by HTML5/geolocation with geocoder uses MAC address of the network card and it displays a more accurate location...
I need at least the neighborhood (with a pin in the map) from requested geolocation to the user.

Related

Asking for an Address using Google Actions Builder

I am attempting to build a Google Assistant app using Google Actions Builder(Not Dialogflow).
I am wanting to ask the user for an Address so I can then geocode this address. I have managed to get the users current location after asking for permission but I am unsure how I can get an address from the user should they decide not to use their current location.
I would hope that the user could be requested to Speak or type an address and I can then geocode this address. I have seen that in the legacy Actions SDK there was a place type. This does not seem to be available in Actions Builder.
I am unsure how to get and store a spoken address.

LinkedIn OAuth: How to access Location and Positions info from LinkedIn Users?

Based on LinkedIn Documentation:
The following selection of profile fields are available to all
LinkedIn developers:
Basic Profile Fields
Location Fields
Position Fields
However, when creating a LinkedIn OAuth app (https://www.linkedin.com/developers/apps), I only get access to Basic Profile Fields (through the r_liteprofile scope).
How do I enable access to Location and Position Fields (and what are the corresponding scopes)? My intention is to avoid having to request Partner Program membership as (1) I dont need as much info and (2) it takes a while to get approved.
Thanks in advance, Miguel.

Get user info via Google API for IP address

Is it possible to get information from user's profile via Google API? If it is possible, which API should I use?
I'm interesting in such information:
Url to the user profile
Gender (sex);
Profile photo.
Ip address wherefrom he/she login
I am getting other user information but How we can get IP address of the current session using google API ?
Currently I am giving SCOPES = "https://www.googleapis.com/auth/userinfo.email"
For getting userinfo I am using session.get('https://www.googleapis.com/userinfo/v2/me').json()
You should check out the Google+ API. Just so you know, it’s being deprecated, with a full shutdown in March.

How do I determine if a user exists in Desire2Learn's Learning Environment?

Our institution has site-wide services that integrate with the D2L Learning Environment. Occasionally a user with an account on one of our other services attempts to visit the Learning Environment before that user has a provisioned user record in the LE, and this results in an authorization error. Does the Valence Learning Framework API provide a way for me to verify that a user record exists in the LE before we redirect a user's session on another service to the LE's login path?
You can use the standard user query route to look for a user record in the D2L LE; using one of the orgDefinedId or userName query parameters, you can look for a user by their organization-defined ID (for example, a student number), or by their LMS user name (that they'd use to log in). For the second to work, naturally you'd need to have the practice of provisioning D2L LE users with the same user name they'd have for your institution's other services.
Notice that the "user" making the call to this route will need sufficient privileges to find the user record (and see the fields they're looking for).

Knowing if a twitter user has location enabled

I'm writing an app that posts tweets to Twitter. I'd like to offer the option of including location in the tweet, which is available via POST statuses/update using the lat and long parameters.
Here's my problem: if a twitter account hasn't turned on location tweeting via https://twitter.com/settings/account "Add a location to my Tweets", then I can send the tweet with the location info, but the location info won't appear. This is a GOOD THING for the user's security, but an annoyance for me because:
If the user hasn't turned on this feature, I shouldn't be offering it in my UI. It's a bad user experience to let the user THINK he can include location information, but then not have the information appear because of some setting outside my control.
So here's my question: Is there a way, through the twitter api, to know if a user has turned on this setting in his twitter settings? I've looked through GET users/show, but can't find anything there that mentions what I'm trying to find out.
Well after some more digging, it turns out that there's a "geo_enabled" key that is included in responses from several twitter endpoints. It's accessible from GET account/settings, of course, but it also often appears in responses to GET users/lookup and probably several other endpoints that return user data.
If "geo_enabled" is true, then the user has agreed to let location data get posted in his tweets. If it's false or doesn't appear, then I'm going to assume that the user hash't turned on this feature.

Resources