Node + Google Street View: How to check if a Street View is available in a certain radius - node.js

I'm trying to use Node and Google Street View together (Google doesn't officially support this). However, one of the things I noticed about Street View is that if you supply it with a point that doesn't have a Street View... it doesn't do anything...
I would like to use Node to reference the Google Maps API (Street View specifically) to find a point within a radius that has a Street View.
I saw a few packages like: https://github.com/moshen/node-googlemaps
but the docs aren't all that helpful. I know this API can be used to generate an image of a Street View, but I'm looking to find a point so that I can send it to a client so that they can display an interactive Street View (Street View Service).
Is any of this at all possible? This may have been worded a little bit weirdly... any questions just let me know!
Thanks!

I think this sample provided just that: https://developers.google.com/maps/documentation/javascript/examples/streetview-service
on init, they add a on click listener with sv.getPanoramaByLocation(event.latLng, 50, processSVData);, which let the street view search a point with data within 50m of the given point, then call the processSVData. Within the call back, they check if there is any points returned by checking if (status == google.maps.StreetViewStatus.OK), if so, the location that contains a street view is return in data.location.pano, which is what they used to add a marker.
I think you should be able to do the same thing in the back end too.

Related

Tweepy-Twitter Python : Get trends where no WOEID available

I've reading docs about twitter api's and I know how to get the trends for available countrys with Woeid (where on the world id).
Twitter has a list of countrys for which they can show the trends. When you list the availables places for trends you may notice that not all cities are supported.
My problem is that I need the trends for a country that has not support for its API. The country I need is El Salvador. This country has no support on the API, neither Woeid. But you can go to homepage and you will see the local trends to the right of window.
There is an option: get the latitude, longitude of El salvador and search trough twitter geo API for trends, but it will return you the trends for other country (Guatemala).
So, as far as I searched, using the api is not an option. Is there another way to get the twitter trends from El Salvador?
Ok, I’ve been doing what you need today.
Without being able to do an api call, which yahoo don’t support, go here;
https://www.yahoo.com/news/weather/el-salvador/apopa/apopa-76867
When you search a city, the woeid is added to the address bar.
Eg Apopa, El Salvador is 76867
Type in city names in yahoo weather and get the ones you need.
Not the best solution but should work for what you need.

How to use nominatim.openstreetmap.org/search to limit results at radius of 1km?

When using https://nominatim.openstreetmap.org/search?format=xml&q=bahamas%20ponte%20nova&addressdetails=1&limit=3
I have exactly the result that I want.
But if you delete the name of my city "Ponte Nova", in the result comes up to references from Spain, but no results come from my city.
How do I get the results to focus on a given radius?
Please see see Nominatim API documentation.
According to section Result Limitation you can use viewbox=<x1>,<y1>,<x2>,<y2> and bounded=1 to restrict the search results to a specific area.
Example: https://nominatim.openstreetmap.org/search?format=xml&q=bahamas&addressdetails=1&limit=3&viewbox=-43.00804%2C-20.36925%2C-42.73699%2C-20.44969&bounded=1

Sphinx "reverse" search

We have a website where users put up ads for stuff they want to sell, with parameters such as price, location, title and description. These can then be searched for using sphinx and allowing users to specify min- and maxprice, a location with a searchradius (using google maps) etc. Users can choose to save these searches and get emails when new ads appear that fit their search. Herein lies the problem: We want to perform a reverse search every time an ad is posted. With the price, location, title and description as parameters we want to search through all the saved "searches" and get the ones that would have found the ad. The min- and maxprice should just be performed in a query i suppose, and some Quorom syntax to get all ads with at least 2 or mby just 1 occurance in the title/description. Our problem lies mostly in the geo-search. How do we find all searches where the "search-circles" would include our newly posted location without performing a search for every saved search?
That is the main-question, any comment on our suggested solution to the other problems is also very welcome. Thank you in advance / Jenny
The standard 'geo-search' support on sphinx should work just as well on a Prospective Index, as a normal retrospective search.
Having built a sphinx 'index' of all the saved searches...
And you run a query using the 'ad' as the search query:- rather than the 'filter' using a fixed radius, you just use the radius from the attribute (ie the radius stored on the particular query) - if using the API cant use setFilterRange directly, need to use setSelect, to make a new virtual attribute.
$cl->setSelect("*,IF(#geodist<radius,1,0) as myfilter");
$cl->setFilter('myfilter',array(1));
(and yes, the min/maxprice can just be done with normal filters too - just inverting the logic to that you would use in a retrospective search)
... the complication is in the 'full-text' query, if the saved search is anything more than a single keyword, but you appear to have already figured out that part.

Foursquare get venue details

We are planning to use foursquare api to get venue in a particular city. I want data of all the food outlets in a particular city. I have managed to get the categories list but not sure how to get venues from that particular category in a particular city or area.
Please share some tutorials or document which i can check out.
One way of doing what you want will be using the Venues Platform for browsing according to a category ID.
Look at venue search API reference.
Example of using it:
I know that 4bf58dd8d48988d11f941735 is nightlife (just picked the first one I saw)
So I will call the API (the ll is someplace in New York):
https://api.foursquare.com/v2/venues/search?ll=40.7268,-73.9972&categoryId=4bf58dd8d48988d11f941735&limit=50&intent=browse&radius=1500&your ids/oauth
Or use the explorer to see results right away.
Important, read the search API and the parameters used here to alter behavior to your needs.
Another very important thing, the API parameters are case sensitive!! (so if they want categoryId, categoryid will not work :) )

WATIR: how do drive outlook web access

since the emails loads dynamically how do you find a specific email that contains a button back to your site. This is like signing up at a site. Customer receives email to confirm.
Thanks for the support
BigD
OWA, bless MS's little hearts (at least in the circa 2003 version I'm looking at here) uses frames, so first of all brush up on that or you are gonna be hating life. The list of incoming messages is in a frame named 'viewer' The message summaries are contained in a table lacking any useful means to identify it that is in a div of class 'msgViewerCont" and an ID of dvContents. So to see if a message exists you want to look to see if you can find a row in that table which contains the subject you expect to see.
(be careful using ID values on OWA.. apparently nobody in the group that developed it read the part of the HTML standard that specifies that ID values are supposed to be unique.. the re-use them all over that page.)
Presuming you know the subject of the message you are about to receive, and also that you keep that mail account cleared out so that it will be the ONLY message there with that subject line, then you can check to see if it exists usng
subject = regex.new("subject you are looking for")
browser.frame(:name, 'viewer').div(:id, dvContents).table(:index, 1).row(:text, subject).exists?
to click on it use .click instead of exists.
once you've clicked it, OWA will refresh the PreviewPane iframe.. inside that iframe is another one that has the message body in it.
all those frames, are nested inside the viewer frame. welcome to nested frame hell. hope you enjoy your stay. (like I said, bone up on frames, you're in for a fun ride)

Resources