GithubHelp home page GithubHelp logo

madenwala / yelp.api Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 11.0 1.21 MB

C# Portable Class Library for Yelp (Fusion API v3 from 2017). Works with Windows 10, Windows 8, Windows Phone, ASP.NET, Xamarin (iOS/Android), Mac, and other .NET projects. Yelp's (v3) Fusion API allows you to get the best local business information and user reviews of over million businesses in 32 countries.

C# 99.87% Batchfile 0.13%

yelp.api's Issues

37,786882' is not of type 'number

I am just tryining run code from tutorial:

var client = new Yelp.Api.Client("API_KEY");
var results = await client.SearchBusinessesAllAsync("cupcakes", 37.786882, -122.399972);

data.Result == {Yelp.Api.Models.ResponseError}

I need some help setting up Yelp API

I need some assistance getting the Yelp API up and running on my project. I'm fairly new to C# programming. I have downloaded the API off nuGet through Visual Studio 2017. It is a Visual C# .Net Core console App.

My output is:

System.Runtime.CompilerServices.AsyncTaskMethodBuilder1+AsyncStateMachineBox1[System.Threading.Tasks.VoidTaskResult,yelp_api_demo.Program+d__1]

Here is my code:

using System;
using System.Threading.Tasks;
namespace yelp_api_demo
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(YelpAPICommands());

            Console.ReadKey();
        }

        static async Task YelpAPICommands()
    {
        var client = new Yelp.Api.Client("API KEY HERE");
        var results = await client.SearchBusinessesAllAsync("cupcakes", 37.786882, -122.399972);
        return;
    }
}
} 

I'm getting no compiling errors but I do get a warning that says:

"Warning NU1701 Package 'Yelp.Api 1.3.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project."

I still get similar problems with a regular C# console app.
Thank you for any assistance.

Not compatible with netcoreapp1.1

Hello,

I'm trying to use this with a netcoreapp1.1 website and it is not working. It seems to only target .NETPortable. When I tried to install the NuGet package I get the following errors:

Package Yelp.Api 1.2.0 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Yelp.Api 1.2.0 supports: portable45-net45+win8+wpa81 (.NETPortable,Version=v4.5,Profile=Profile111) One or more packages are incompatible with .NETCoreApp,Version=v1.1.

Package Yelp.Api 1.2.0 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1) / win. Package Yelp.Api 1.2.0 supports: portable45-net45+win8+wpa81 (.NETPortable,Version=v4.5,Profile=Profile111) One or more packages are incompatible with .NETCoreApp,Version=v1.1 (win).

Package Yelp.Api 1.2.0 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1) / win-x64. Package Yelp.Api 1.2.0 supports: portable45-net45+win8+wpa81 (.NETPortable,Version=v4.5,Profile=Profile111) One or more packages are incompatible with .NETCoreApp,Version=v1.1 (win-x64).

Package Yelp.Api 1.2.0 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1) / win-x86. Package Yelp.Api 1.2.0 supports: portable45-net45+win8+wpa81 (.NETPortable,Version=v4.5,Profile=Profile111) One or more packages are incompatible with .NETCoreApp,Version=v1.1 (win-x86).

I inserted your code directly into my project and it seems to work fine. Any reason this is only targeting .NETPortable?

Thanks.

Would you mind if I maintained a Web version of this?

Hello,

I've submitted a few pull requests to you of new functionality. I'm using this in a web app and I think other people would want to use it for the web. Would you mind if I maintained a fork of this and a NuGet that targets web apps? I'd probably have it target various versions of netcoreapp.

I would of course give you credit for starting it and link back to your original GitHub Repo and NuGet package. I don't think I'd be adding any more functionality (for now) than what I've already submitted to you as a pull request.

Thanks.

Can't search business by phone number

The SearchRequest class is missing Phone member to allow the developer to search business by phone number.

SearchRequest is a sealed class so is not possible to override.

"Error converting value {null} to type 'System.Double'. Path 'coordinates.latitude'

It seems for every YelpFusion api I use I get a similar issue when I am placing a lattitude/longitude value in the autoComplete/GetBusiness/Search functions of the yelp.Api. I really don't know how to get around this. For a test scenario, I used:

request.Term = "Papa Johns Pizza";
request.Latitude = double.Parse("30.0477325");
request.Longitude = double.Parse("-95.18446720000003");

I even used request.Location = "2855 W Lake Houston Pkwy, Kingwood, TX 77339, USA";

From here when I run the GetSearch I run into the error converting value {null}. I tried doing some searching on why this was the case but couldn't find anything.

I also did a test case where I ran autoComplete for this, which gave me a business Id.
request.Term = "Domino's Pizza";
request.Latitude = double.Parse("30.0498865");
request.Longitude = double.Parse("-95.18670780000002");

I even used request.Location = "4319 Kingwood Dr, Kingwood, TX 77339, USA";

From the business Id I try to get the business from the GetBusiness call but I run into the same error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.