Getting Location of Tweets found with Twitter Search API - windows-phone-7

Whenever I search for tweets using the geocode option, the returned tweets have "null" as their geo property. They are definitely coming from the right place because the location property has a name which is in the correct area, however I want to know what the coordinates of the tweet are so I can place on on a map (specifically Windows Phone).
I've tried a really hacky solution of searching for the location using the geo api, but this seems a really awkward way of doing it and often returns bad results (I want results from Oxford, UK but often the geo search return Oxford, IN for example).
Looking around, it seems Twitter's geolocation is currently broken, but I really need this to work for a presentation on Thursday demonstrating an app we built in a group, and it would really suck if our main feature didn't work.

Twitter's search API is broken. It will not return some information which is available through the regular API.
Once you have found a Tweet, you can try looking it up directly using statuses/show
For example, calling one of my tweets:
https://api.twitter.com/1/statuses/show.xml?id=202471009973051393&include_entities=true
gives
<geo>
<georss:point>51.52505194 -0.132582</georss:point>
</geo>
<coordinates>
<georss:point>51.52505194 -0.132582</georss:point>
</coordinates>

Related

iOS Mapkit, identifying "type of business"

I've looked through numerous answers (most were slightly outdated), and I was wondering if Apple had some sort of way to identify the type of business it queried?
From the reference guide, MKMapItem has 5 variables, none of which tell me a place is a "Thai Restaurant" or something like that.
placemark
isCurrentLocation
name
phoneNumber
url
I think its interesting how when you do a MKMapkit query on "thai", it'll give you a list of thai restaurants but thats a one way street and no where later can I take a result from the query on "thai" to verify that it is indeed a "thai" restaurant. More importantly, what I am particularly interested in is if a business is a "Thai" restaurant and a "Bar" as well, I want to be able to do a MKMapKit query on "Bar" OR "Thai" and be able to get both of those tags
I can see a solution of getting the coordinates of a business then using Google Maps API or even Yelp API and doing a search on there to get the "type of business" but that seems extremely cumbersome and inefficient.
Thanks for any advice! One of my first questions so please so easy on me =)
First, take a look with this link : http://www.raywenderlich.com/13160/using-the-google-places-api-with-mapkit
The google API will send back the name, type, location of business location near you.
It's also send icons(via image link) of business location, so you can display it on the map, which can help you which is market, which is coffeeshop...
But the "Thai Restaurant" maybe too detail so google doesn't want to show it.
Sorry about my bad english.
Hope it help.
For that you should use google near by place search or place search api. you can pass thailand as place name and restaurant to type and it will return you all the restaurant in thailand.

Ruby viewpoint with EWS

I am trying to get started using viewpoint against EWS within Ruby, and it's not making a lot of sense at the moment. I am wondering where I can get some good example code, or some pointers? I am using 1.0.0-beta.
For example: I know the name of the calendar folder I want to use, so I could search for it, but how to access methods in that folder once I find it? What are the appropriate parameters, etc...
Any advice?
If you haven't read it yet I would recommend the README file in the repository. It has a couple of examples that should put you on the right path. Also, the generated API documentation should give you enough to work with.
http://rubydoc.info/github/WinRb/Viewpoint/frames
At a very basic level you can get all of your calendar events with the following code:
calendar = client.get_folder :calendar
events = calendar.items
I hope that gives you a little more to get started with.
Follow-up:
Again, I would point you to the API docs for concrete methods like #items. There are however dynamically added methods depending on the type that you can fetch with obj.ews_methods. In the case of CalendarItem one of those methods is #name so you can call obj.name to get the folder name. The dynamic methods are all backed by a formatted Hash based on the returned SOAP packet. You can see it in its raw format by issuing obj.ews_item
Cheers,
Dan

Google places api restaurant types

When you search for a restaurant in Google places and go to the business profile (i.e.:
https://plus.google.com/107507038669791289691/about?hl=en) the restaurant has a tag (in this case Mexican Restaurant). But when using the Google places api all I can see is a types list
"types" : [ "restaurant", "food", "establishment" ]
Anyone know if it's possible to get the tag "Mexican Restaurant" somehow?
I know about the supported types (https://developers.google.com/places/documentation/supported_types). It is not super helpful.
I was also working in a project which need to get more details about a place using Google Maps and Google Places APIs, and I really spent many hours trying to find something that can help ( Google Places API, Google Maps API, google+ APIs, ... ) but nothing ... the only things that I found is theses 2 issues ( feature requests ) which I hope that Google will add to their APIs someday :
Issue N° 5260 with 13 stars.
Issue N°7878 with 4 stars.
I hope with this SO question that we get more interested persons to get the feature in a soon future version of Google Map or Google Places APIs.
For the Google Places for Work API, I didn't find any information to confirm or not that it contains such feature, but I don't think so.
Hope that can help.
I think you would probably have to revert to the text search method on the api..
https://developers.google.com/places/documentation/search#TextSearchRequests
So your request would end up looking something like the below, restricted down to a specific area
https://maps.googleapis.com/maps/api/place/textsearch/json?query=Mexican+Restaurant&sensor=true&location=40.846,-73.938&radius=20&key=yourKeyHere
However this will return all other Mexican restaurants in the area, so if you just want to return the one result I would use the Place Details request instead.
Separate your place types by PIPE symbol "|"
try like this :
String types = "cafe|restaurant|museum" // Listing places only cafes, restaurants and museums.

Find exhaustive list of restaurants around a location within a specified radius in android

I am working on an Android App. I want to get list of all restaurant around me within a specified radius(let say 5 miles). I tried using Google places API and it works, however it limits the number results returned to 20, what if there are more than 20 restaurant in that radius around me. How do I get an exhaustive list of all the restaurants? What is the best way to do this? Is there something other than Google Places API that I can use? Thanks for your help in advance.
If you want to do it server side you can use this guy's class :
http://andrenosalsky.com/blog/2011/google-places-api-php-class/
and you have to get an api key as it is explaned here :
http://code.google.com/intl/fr/apis/maps/documentation/places/
then you can send data in JSON format to your Android

how to get Route directions between two points on a map to draw driving directions?

is there a way to use core location or google or some other api to provide two points on the map and get the resulting set of latitude/longitude pairs for the route?
i have seen in this tutorial Drawing polyines or routes on a MKMapView that how to draw driving direction using core graphics...but in the sample code it has route.csv which has predefined set of longitudes and latitudes.....how do i make pair of longitudes and latitudes so that i can draw driving directions.
Companies invest millions of dollars into developing routing algorithms, so I very much doubt that you'll be able to get it for free anywhere (I'm happy to be wrong, though). For example, the Google Maps JavaScript API supports routing, so I guess you could hack that up. The results wouldn't be fast or pretty, mind you.
If you have a limited use of the directions request (less than a certain amount per day) and always display results on a Google map, you do qualify for the free Google Directions API.
https://developers.google.com/maps/documentation/directions/
Read the license part thoroughly to know the limits. You should easily be able to request a json response that will b easier to parse than an xml one (plus Apple added json parser in iOS).
For example
http://maps.googleapis.com/maps/api/directions/json?origin=Boston,MA&destination=Concord,MA&waypoints=Charlestown,MA|Lexington,MA&sensor=false
If you are over the limit, you should look into their business licenses.
Old question but MTDirectionsKit was recently open sourced and it works great:
MTDirectionsKit
with Google API you can get directions from two points, the only problem is you just can use it once a day if you don't pay.
Search how to get the key API from google, there are a lots of videos on youtube talking about it.
Furthemore, i got a library which hepls you to draw the line between points this one https://github.com/jd-alexander/Google-Directions-Android
After you implemented it in build.gradle(Module:app), implement the library in the class like
public class LocationMapActivity extends AppCompatActivity implements RoutingListener
will appear a error to implemets the methods (obligatory to implement them but It's not necessary to use them).
I just did this:
public void route(){
Routing routing = new Routing.Builder()
.travelMode(/* Travel Mode */)
.withListener(/* Listener that delivers routing results.*/)
.waypoints(/*waypoints*/)
.key(/*api key for quota management*/)
.build();
routing.execute();
}
More info in the link.

Resources