Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

[Suggestion] Link to Futbin page of a player #55

Closed
omasseau opened this issue Oct 18, 2017 · 9 comments
Closed

[Suggestion] Link to Futbin page of a player #55

omasseau opened this issue Oct 18, 2017 · 9 comments

Comments

@omasseau
Copy link

It would be very useful to be able to click on the current Futbin price icon.
This click would open the Futbin page of the player in a new tab of the browser.
It could be very useful to quickly check the price history of a player.

@omasseau
Copy link
Author

It could also be implemented as a new button next to the 'Search min BIN' button.
Maybe easier than clicking on a tiny icon ;)

@renard0
Copy link
Contributor

renard0 commented Oct 18, 2017

I did some research and currently see no scrict way to get a link to particular player on Futbin.
The resourceId from web app and player id on futbin are different though they mapped on futbin side. The possible decision is to make a search request for each player but it doesn't seem fair enough to bomb futbin with requests.
Maybe futbin could gain access to some endpoint if asked.
@Mardaneus86 Did you talk with Futbin owners before?

@IvoPereira
Copy link

Without really touching the details -as it is the first time I see this project -, what about calling the search endpoint that is called on Futbin with the specific player name as an argument and, if there isn't a direct match in the response (aka a unique result), what about doing some direct match with all the rest of the attributes (like rating and position) that are retrieved too?

@renard0

@Mardaneus86
Copy link
Owner

Endpoint that futbin uses for the search is: https://www.futbin.com/search?year=18&term=<player_name>.

However, that might return multiple results for a single player. Output of a search for De Bruyne gives this:

[
    {
        "rating": "90",
        "position": "CM",
        "club_image": "https://cdn.futbin.com/content/fifa18/img/clubs/10.png",
        "image": "https://cdn.futbin.com/content/fifa18/img/players/192985.png?v=2",
        "rare_type": "3",
        "full_name": "De Bruyne",
        "name": "De Bruyne",
        "id": "15541",
        "nation_image": "https://cdn.futbin.com/content/fifa18/img/nation/7.png",
        "rare": "1",
        "version": "IF"
    },
    {
        "rating": "89",
        "position": "CAM",
        "club_image": "https://cdn.futbin.com/content/fifa18/img/clubs/10.png",
        "image": "https://cdn.futbin.com/content/fifa18/img/players/192985.png?v=2",
        "rare_type": "1",
        "full_name": "De Bruyne",
        "name": "De Bruyne",
        "id": "78",
        "nation_image": "https://cdn.futbin.com/content/fifa18/img/nation/7.png",
        "rare": "1",
        "version": "Normal"
    }
]

So that would be a viable option.

I've asked Futbin, and they didn't disapprove the use of their service. We just have to take care not to bash their servers too much. Linking would help them get more traffic, so I don't think they would mind.

@renard0
Copy link
Contributor

renard0 commented Oct 21, 2017

@ IvoPereira As I mentioned, making search request is an option I'm just bother of not flooding futbin servers. Each page has 30 items I guess, which is 30 search requests.
@Mardaneus86 This is an option but still would be better to use some API call once to get all ID's instead of searching for every single player. It's pretty easy thing to do for futbin if they don't have it already

@Mardaneus86
Copy link
Owner

Futbin is not creating custom API endpoints for us, so I've created a local cache based on the endpoint I stated above. It fetches the players based on player name, and matching them on rating. If more than 1 player is found with the same rating, no link is shown for now until I figure out a better way to uniquely identify them.

Once a futbin player ID is retrieved, it is stored and not retrieved again, so Futbin doesn't get an overload of requests.

@Mardaneus86
Copy link
Owner

Fixed in v0.2.1.

@Mardaneus86
Copy link
Owner

Current version seems to hit a rate limit when searching through the club list. Perhaps need to add the link in the detail panel instead of in the list, so the link can be fetched when an item is selected.

@Mardaneus86
Copy link
Owner

Fixed in v0.2.2. Introduced a new button in the player detail panel. The futbin link is only determined when you want to open it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants