So here it goes, some VB.NET code to get businesses that match some common terms within a 1 mile(?) radius of a given latitude and longitude.
Public Sub getNearbyLocations(ByVal myLatitude As Long, ByVal myLongitude As Long)
If gps_allowed = True Then
myThrobber.Visibility = Visibility.Visible
myWebClient = New WebClient()
myWebClient.OpenReadAsync(New Uri("http://api.yelp.com/business_review_search?term=food%20bars%20pizza%20bar%20diner%20bar&lat=" & myLatitude & "&long=" & myLongitude & "&radius=1&limit=20&ywsid=YOURYELPAPIKEY"))
AddHandler myWebClient.OpenReadCompleted, AddressOf gotJson
Else
MessageBox.Show("You need to allow this application to use the GPS in the settings panel to use this function!")
End If
End Sub
Private Sub gotJson(ByVal sender As Object, ByVal e As OpenReadCompletedEventArgs)
For Each businessObject As yelpBusiness In placesMainPanel.Children
businessObject = Nothing
Next
placesMainPanel.Children.Clear()
Dim sr As New StreamReader(e.Result)
jsonString = sr.ReadToEnd
Dim jsonThing As New jsonStuff(jsonString)
For Each returnedBusiness As yelpResponse.business In jsonThing.myYelpResponse.businesses
Dim myNewBusiness As New yelpBusiness
myNewBusiness.lblBusinessName.Text = returnedBusiness.name
myNewBusiness.lblAddress1.Text = returnedBusiness.address1
myNewBusiness.lblAddress2.Text = returnedBusiness.city & ", " & returnedBusiness.state_code & " " & returnedBusiness.zip
myNewBusiness.lblReviewCount.Text = returnedBusiness.review_count & " Reviews"
myNewBusiness.imgRatingStars.Source = New BitmapImage(New Uri(returnedBusiness.rating_img_url))
myNewBusiness.imgPlacePhoto.Source = New BitmapImage(New Uri(returnedBusiness.photo_url))
myNewBusiness.lblReadReviews.NavigateUri = New Uri(returnedBusiness.url, UriKind.Absolute)
myNewBusiness.lblReadReviews.TargetName = "_blank"
myNewBusiness.btnLeaveReview.NavigateUri = New Uri("http://www.yelp.com/writeareview/biz/" & returnedBusiness.id)
myNewBusiness.btnLeaveReview.TargetName = "_blank"
placesMainPanel.Children.Add(myNewBusiness)
Next
myThrobber.Visibility = Visibility.Collapsed
End Sub
Imports System.Runtime.Serialization.Json
Imports System.Runtime.Serialization
<DataContract()> _
Partial Public Class yelpResponse
<DataMember()> _
Public Property message As yelpMessage
<DataMember()> _
Public Property businesses As List(Of business)
Public Class yelpMessage
Public Property text As String
Public Property code As Integer
Public Property version As String
End Class
Public Class business
Public Property rating_img_url As String
Public Property country_code As String
Public Property id As String
Public Property is_closed As Boolean
Public Property city As String
Public Property mobile_url As String
Public Property review_count As Integer
Public Property zip As String
Public Property state As String
Public Property latitude As Double
Public Property rating_img_url_small As String
Public Property address1 As String
Public Property address2 As String
Public Property address3 As String
Public Property phone As String
Public Property state_code As String
Public Property categories As List(Of category)
Public Property photo_url As String
Public Property distance As Double
Public Property name As String
Public Property neighborhoods As List(Of neighborhood)
Public Property url As String
Public Property country As String
Public Property avg_rating As Double
Public Property longitude As Double
Public Property nearby_url As String
Public Property reviews As List(Of review)
Public Property photo_url_small As String
End Class
Public Class category
Public Property category_filter As String
Public Property search_url As String
Public Property name As String
End Class
Public Class neighborhood
Public Property url As String
Public Property name As String
End Class
Public Class review
Public Property rating_img_url_small As String
Public Property user_photo_url_small As String
Public Property rating_img_url As String
Public Property rating As Integer
Public Property mobile_uri As String
Public Property url As String
Public Property user_url As String
Public Property text_excerpt As String
Public Property user_photo_url As String
Public Property date1 As String
Public Property user_name As String
Public Property id As String
End Class
End Class
Confused about 'jsonStuff' object?
ReplyDeleteAbsolutely fantastic posting! Lots of useful information and inspiration, both of which we all need!Relay appreciate your work. Buy Yelp Reviews
ReplyDeleteDoors open very often for persons who buy Twitter followers and use the additional boost correctly. The startup of followers is not essentially the end of your promotion plan, it must be merely the start.Buy Twitter Followers
ReplyDeleteThe sponsored posts are linked to the user’s profile, where another user can decide to be a follower.Buy Twitter Followers
ReplyDeleteAre you seeing to Buy Full Email Verified SC Accounts as foremost profile otherwise additional? If yes, you could get the prepared Email Verified Sound Cloud Accounts. Everybody knows around Sound cloud Social Media Auditory site. Really it is the Audio Melody site in USA. There are lots of Music Group in this website like HipHop, Traditional, Deep-House, Substitute Rock etc. Buy Full Email Verified Soundcloude Account
ReplyDeleteWhen you own a business, you know very well that customer reviews are extremely influential. From Google To FACEBOOK people are sharing their experiences on all, and what they say has a huge impact. Over 90% of contributors claimed that online positive reviews influenced their purchasing decision, and 85% said their decision was influenced by minus reviews.Buy Google 5 star Reviews
ReplyDeleteBusiness can power up their relationship with customers by straightly linking with reviewers on Google. Buy Google Reviews
ReplyDeleteInvestigation displays that online reviews drive additional sales than customary marketing means for example social media, advertising, as well as organic search results. Buy Google 5 Star Reviews
ReplyDeleteGoogle reviews can either be positive or negative for your business, stores, office, restaurant, service or requirements. Google is the largest search engine, as well as the most efficient advertisement website.Buy Google 5 star Reviews
ReplyDeleteMany business persons out there are worried about whether buying negative reviews is a good idea or not due to its safety. You can contact us at MangoCityIT and let us take you through a process that will make you understand the importance of these reviews and how we make them appear more realistic and safe for your business. Buy Negative Reviews
ReplyDeletewe perform operate work owing to you. As you Product mainly founded web page /apps desire continue rated, thou accomplish get a lot above clients through online.Buy Google Negative Reviews
ReplyDeleteClients are more prone to write about negative experiences online. It’s the simplest means to get back at terrible client service. If you are neglecting or ignoring the power of negative customers’ reviews, you are making a huge mistake.Buy 1 star Google Reviews
ReplyDeleteBuy Google Reviews is a new era of advertising and service in which your business/brand is defined by those who experience it. Buy Negative Google Reviews
ReplyDeleteWe provides the most genuine Google Reviews, and it is exactly what your business firm needs to achieve success in the world of business.Buy Google reviews Cheap
ReplyDeleteThe key features of this service are that all page reposts are permanent). Second, you’ll get 100% satisfaction assurances. The service delivery time is 10 hours. No programs, bots, or software are used in this service. When you buy this service, it’s a 100 %stable and safe account, with real high-class campaigns as well as 100 % safety and security, as well as customer satisfaction. With this service, you’ll save time and effort. You’ll experience improvements within 24 hours.
ReplyDeleteBuy SoundCloud Play
These are not new to the business. we’ve been dealing in business since we had a business.Buy Google Reviews
ReplyDeleteThese are not new to the business. we’ve been dealing in business since we had a business.Buy Google Reviews
ReplyDeleteWe would like to present you to SoundCloud Viral wherever we do as the name suggests – make you viral on Sound Cloud.Buy SoundCloud Plays Promotion
ReplyDeleteThinking before buying Google reviews is not a bad idea. This write up will help you in the making the decision to purchase Google Reviews for your business! Buying Google reviews applies to both those who are in business for the first time as well as those who already have an account. Buy Google Negative Reviews
ReplyDeleteMangocity IT Absolutely fantastic posting! Lots of useful information and inspiration, both of which we all need!Relay appreciate your work. Buy Yelp Reviews
ReplyDeleteTop Promoter This is really a nice and informative, containing all information and also has a great impact on the new technology. Check it out here: Facebook Promotion
ReplyDeleteTop SEO Work Excellent information on your blog, thank you for taking the time to share with us. Amazing insight you have on this, it's nice to find a website that details so much information about different artists. Old Gmail Accounts
ReplyDeleteThanks for this article very helpful. thanks. Buy Google Reviews USA
ReplyDeleteread that Post and got it fine and enlightening. If you don't mind share more like that... Buy Press Releases
ReplyDelete
ReplyDeleteBuy Soundcloud Service
This is my first time i visit here. I discovered such a large number of fascinating stuff in your online journal particularly its dialog. From the huge amounts of remarks on your articles, I figure I am by all account not the only one having all the satisfaction here! keep doing awesome BUY POSITIVE GOOGLE REVIEWS
I love reading through this article because it is full of excellent information and interesting facts. The Data Contract Serializer sounds like a really cool program. Browse around this website to get breaking news on google reviews.
ReplyDeleteBuy Verified Cash App Accounts
ReplyDeleteWe are able to provide you with the best Verified Cash App Account. Buy Verified Cash App Accounts With Replacement Guarantee We would be your best seller. We have the biggest team for customer support so don’t worry about buying cash app accounts from us. Don’t be afraid about buying any product on our website because we are the agency and we provide guaranteed accounts. To Avoid Scams Only buy From an Agency.
We are Providing a 100% BTC-Enabled Cash App account. SSN, Number, Passport, Email, Photo, ID Card, Driving License Fully verified with the document.
Our Accounts Are 100% Legit And Verified
✔ 100% phone verified USA, UK, and other countries
✔ Email Login Access
✔ 100% BTC Withdrawal Enabled
✔ NIDs, SNNs Card Verified
✔ Real Gmail used USA, UK, and other countries
✔ Bank Added
✔ Driving License Scan Copy
✔ Phone Access – Fast Delivery
✔ 24/7 Customers Support
✔ USA, UK Bank Verification
✔ Email & Phone Verified
✔ 24/7 Customers Support
24/7 Ready to Contact Us
⏩ Whats App: +1(408)3207683
⏩ Telegram: @BuyServiceShop
⏩ Skype: BuyServiceShop
⏩ Email: buyserviceshop2005@gmail.com