Giter Site home page Giter Site logo

goodreads-dotnet's People

Contributors

adamkrogh avatar brazenrazin avatar iamyoshita avatar ianhoppes avatar mmmmmmmmm2 avatar vladimirrybalko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

goodreads-dotnet's Issues

OAuth Question

Hello, I am a bit new to OAuth, but am struggling to understand how this library can be used to get access to an authenticated user's data.

The example includes these two lines:

// Create an authenticated API client
var authClient = new GoodreadsClient("apiKey", "apiSecret", "oauthToken", "oauthTokenSecret");

// Get a user's OAuth access token and secret after they have granted access
var credentials = client.Connection.Credentials.GetAccessToken(apiKey, apiSecret, requestToken, requestSecret);

I have my API Key & Secret... my confusion is related to the other 4 items : oauthToken, oauthTokenSecret, requestToken, requestSecret.
If I do the following:

// Create an unauthenticated API client [because right now I have no tokens, right?]
var client = new GoodreadsClient("apiKey", "apiSecret");

// Get the Goodreads URL to redirect to for authorization
var authorizeUrl = client.Connection.Credentials.GetRequestTokenAndBuildAuthorizeUrl(callbackUrl);

//Incidentally, if I also do this:
var requestToken=client.Connection.Credentials.GetRequestToken().OauthToken;
//requestToken is different from the value in the authorizeUrl... why is that? 

Redirect user to authorizeUrl for "Allow" permission to be granted. Goodreads redirects back to the callBack url including a query string like: "?oauth_token=xxxxxxxxx&authorize=1"

What does "oauth_token" represent? Is this the "requestSecret"?

Example code from callback, which includes the query string data:


 string requestSecret = oauth_token;

            var client = new GoodreadsClient(apiKey, apiSecret);

            var requestToken = client.Connection.Credentials.GetRequestToken().OauthToken;

            //If I then use that as the "requestSecret" with the "requestToken" value (which didn't match the url) like this:
            var credentials = client.Connection.Credentials.GetAccessToken(apiKey, apiSecret, requestToken, requestSecret);

//credentials.OauthToken	is null AND credentials.OauthTokenSecret is null... so... something has gone wrong here.

            // Create an authenticated API client [This won't work because of nulls]...
            var authClient = new GoodreadsClient(apiKey, apiSecret, credentials.OauthToken, credentials.OauthTokenSecret);

I am missing something significant here... Can you point out where I am going wrong?
Thanks

Connection.ExecuteRaw() Hanging...

So, I am doing a call to Client.Series.GetListByAuthorId(author.Id) but it seems to just hang. When stepping through the code, I see that the request is constructed correctly, and the response includes expected XML data from Goodreads:

RestSharpExtensions.ThrowIfException

...
// Try and find an error from the Goodreads response
            string error = null;
            try
            {
                var document = XDocument.Parse(response.Content); <-- response.Content has expected data
...

The code gets to the end of "ThrowInfException" and returns the response without any exceptions.

But when it should just pass back the response data, it seems to get stuck at the very end of "Connection.ExecuteRaw()", and by stuck I mean it never gets beyond it. I have let it continue to run for 3-5 minutes before stopping the running code.

I'm not well versed in asynchronous methods... otherwise I'd try to fix this myself. I'm just not sure why it doesn't complete when the response is there and ready to return...

Thanks

Help with owned books

Hello

This is actually a question: Is there any implementation of "owned books" method?

Issue with "Confirm or decline a friend recommendation" endpoint.

Seems that Goodreads endpoint is not working as describe in an official documentation.
Moreover I think method is not working at all.
There is not an ability to approve a recommendation in a web version. An user need to add a book to his shelf instead. Also I can't ignore a recommendation using the Goodreads API. Server returns the "Not found" response for all my requests.
I'm going to send a bug ticket to the Goodreads support.
Will wait any feedback.

An item with the same key has already been added- Error

I was using the library for one of my projects and encountered this error out of nowhere. All I was doing, calling the client.Books.GetByBookId() method. I've already checked the parameter (BookID=929) and it's a valid one for sure. Furthermore, I've also encountered the same error while using client.Books.GetByTitle() method.
It would be great if you could have a look at the issue.
image

AverageRating

Any reason for not supporting the average_rating property in the XML when doing a book search?

Issue with "Destroy review" endpoint

@adamkrogh, you notes that "Destroy review" endpoint returns strange errors and never works.
I have investigated this and could say that the Goodreads API documentation is wrong.

The strange error said that server can't parse book identifier in request. It's really strange because I do not need to send any book id. I have looked at the web version and found that we need to send a book id instead of a reviewId. I try to do it. Unfortunately, now I'am getting Unathorized error. Moreover I've played with different combinations of parameters, values and request method. Nothing works! It's a sad.
Do you get any feedback from the Goodreads support?

Issue with "Update an owned book".

Seems I have found a bug in Goodreads API again.
The "Update an owned book" always return 404 'Not found' result even if send the correct OwnedBookID.
So I think I collect all known issues together then I create an a issue ticket in Goodreads forum.
However I don't hope that we received any response. It looks like the Goodreads dev team didn't support the public Api anymore.

Genre

The Search function can just search based on given 'id' , 'title' and 'all'. But in order to search based on genre ,
The Code:
[QueryParameterValue("genre")]
Genre

must be added to Goodreads/Models/Request/BookSearchField.cs

I tried it and it works perfectly fine

can't get access token

I was following Goodreads.Demo but I have slightly modified it to adapt on a MVC web app.
On callback I receive oauth_token (its not empty, so I assume it is valid) and authorize == 1 but at the next step when I call client.GetAccessToken, the OAuthAccessToken is empty. Token and Secret are null.

I am running the sample on my local machine.

Further development & migrate to .net core

Dear @adamkrogh
Seems that you don't have time for further development. Unfortunatelly many API methods is not covered yet. The last commit was about one year ago.
I think your project is a very interesting. I'm considering some .net goodreads SDKs and assume that your project is the best. I'm going to implement some missing API methods and migrate library to .NET Core or .NET Standard.
What do you think about some pull requests from me? Could I ask you to add me as a project collaborator. It will facilitate my work.

Thanks in advance.
Regards

Goodreads API bugs

There is a place where we collect all available information about bugs in the Goodreads API.
Unfortunately, some bugs still exist and we don't know when they will be fixed.
If somebody has any ideas how to fix it or create workarounds, feel free to share it with us.

Known bugs below:

  • friend.confirm_recommendation — Confirm or decline a friend recommendation.
  • owned_books.update — Update an owned book.
  • review.destroy — Delete a book review.
  • rating.create — Like a resource.
  • rating.destroy — Unlike a resource.

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.