I would like to let users use Google Maps in my store application to find all of my stores along a specified route.
This is the flow I envision:
User creates a starting point and an endpoint for a trip.
User selects a distance from the route that they would be comfortable traveling to get to one of our stores. This would be in miles, say, from 1 to 50 miles.
Given those parameters, Google Maps displays the route along with markers for all stores within those parameters.
User then can click on the stores they want to visit while driving to the destination.
When they are done, my program will generate a list of all the stores they have selected along their route.
A couple of notes:
I have a database of all of our stores that includes city, state, zip, lat, long. It can also contain all of the info that I want returned to the user when the list of stores are selected on the route such as hours, services, etc.
I just need to know if this functionality is possible within the Google Maps api.
Related
I am planning to build a dating site. but want some suggestion in getting display users data. In my project, there will be no swipe feature instead we use multiple buttons to send different req. to users.
My Motive for the project is to get the nearest active users first according to interests. All of the modules are done only showing the nearest users algorithm is on hold.
we have to calculate the user's distance from the logged-in user location based on latitude and longitude. Then see the active users who are most close to the logged-in user.
I have stored logged-in users' latitude and longitude in DB.
This is a web project built in laravel-8.
I have to fetch 1 user record at a time after getting the nearest active user.
Note: Main I have to get a solution to get the next user on each click. I have tried it with pagination but that is not a good practice. I need some suggestion to other method to get 1 next user data at a time.
You can checkout inRandomOrder().Seems like it can be handled in one query. Further you can create api to get new user each time.
Try this:
$randomUser = DB::table('users')->whereNotIn('id',$userIdArrayAlreadyShown)->inRandomOrder()->first();
I need to automatically generate url to the existing advertisement in google adwords. I've got a link like this:
https://adwords.google.com/cm/CampaignMgmt?authuser=1&__u=%param_one%&__c=%param_two%#c.%param_three%.create&app=cm
I do not know what are those params one, two, and three. I do not know where can I get them and what is their role in an address. But I'd like to! In fact I just need to generate a URL to click on it and appear on an ad page. How can that be done? May be their lib provides a method to generate url like this?
Unfortunately that's not possible, at least not in a reliable way (see also this rather old post from the Adwords API forum).
The structure itself is not hard to parse:
Inside the query string, __u is your user account's ID while __c refers to the ID of the specific Adwords account. These don't appear to be in standard Adwords XXX-XXX-XXXX format, though, so you would have to either create a mapping of all your accounts or come up with the proper translation function.
The fragment refers to a specific Adwords entity, for instance; c.123 is the campaign with ID 123 while a.ABC_XYZ refers to the adgroup with ID ABC inside the campaign with ID XYZ.
But even if you manage to get the __u and __c parameters right, more often than not you will be redirected to your Adwords account's top level view.
Interestingly enough, Google Analytics introduced little buttons in the "Adwords" reporting tab a few months ago which are supposed to take you right to the correct campaign if you have access to the linked account, but even those only work half of the time, especially if your Adwords account is an MCC.
I require 2 bit of data from my twitter account to be dynamically requested.
(1) Followers (as of this month)
(2) Total followers
I have a couple of questions regarding how to get the data & if the data is available.
For (1), is this even available? or is this something I'd need to calculate?
For (2), so far I've been pointed in the direction of the Twitter API & oAuth. Now, to me - just get the total followers for my account - logging in via oAUth & using large class libraries (PHP) seems like total overkill.
How I can get the data I require?
twitter has buttons you can simply drop on your page. this will allow you to show the follower count as well as allow people to follow you directly form whatever page you put it on.
https://dev.twitter.com/web/follow-button
There is no way to get the data you want directly.
Twitter offers an API call which will tell you how many followers you have right now - https://dev.twitter.com/rest/reference/get/users/show
It does not provide historic data via the API - such as how many followers you had at a specific date.
You have two options.
Make that API call at the start of the month and save the result somewhere - then compare your current follower number.
Take a look at https://analytics.twitter.com/user/edent/home (substitute your own name for edent) - you'll see something like this for each month:
There's no API for that data, but you might be able to screen scrape the data you want out of it. Or just manually copy & paste.
I would like to know if is there any possible way to show the total number of users of a specific country in my webpage. As far as I found, you can not get it through API.
I'm guessing you really want the total number of users on facebook who have 'liked' or used facebooks oauth to connected with your site.
Do you use graph api in your site? I'm pretty sure you can query by country name--as long as the user's who have shared that info with you have provided it.
Check this out... http://developers.facebook.com/docs/reference/api/
And this: http://developers.facebook.com/docs/reference/api/insights/
From their site
Facebook Insights provides the ability to see geographic and
demographic data for people that have Liked a Page or installed an
app. Location data is based on the geographic location of each person
as determined by their browser IP address and is limited to the top 20
countries and cities. All other demographic information is aggregated
and non-personally identifiable.
Generic searches can be done like this:
https://graph.facebook.com/search?type=location&place=166793820034304
Where the place id is the id for whatever you want to search on.
https://graph.facebook.com/search?type=location&place=166793820034304
Disclamer: This method is not supported by Facebook. Use it at your own risk. I take no responsibility whatsoever.
Go to: https://www.facebook.com/ads/manage/adscreator/
Fill in the ad info with something random (eg. google.com as the url)
In the next part you'll notice a dynamic reach estimation that changes depending on the parameters you select, including country. Try changing the country and observe the network activity with for instance the developers tools of Google Chrome.
Call the ajax url that returns the json data with the proper parameters programatically, this should be easy to figure out in the previous step.
Collect and store the json data for your evil deeds.
???
PROFIT!
The actual ajax call and parameters change from time to time, which is why I didn't include them directly, but it should be easy enough to figure it all out. Also note that they are estimates, even if they come from Facebook, they don't count every single user every time an advertiser sets up an ad — it's the best estimate you can possibly get though.
This method as I mentioned is neither official nor supported by Facebook, but sites like socialbakers.com or checkfacebook.com have been using them for ages. (There, I revealed the secret)
I need to create a Google map that would display all my app users. The problem is, that that Facebook doesn't seem to provide enough information to do that, country at most. I'd like to display user position on map at least to the proximity of the city.
The only option I see, is to track user's location using their IP. What are the other options?
If the user has provided it, you can get their current location (city, state, country) by prompting for the 'user_location' and/or 'friends_location' permissions.
You might also want to check out the 'user_checkins' and/or 'friends_checkins' permissions for more timely and accurate locations.
http://developers.facebook.com/docs/reference/api/user/
Or as a fallback, like you say, you can usually get an approximate location by their IP. But that's not always very accurate.