Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fotmob_get_match_details scrapes and unnests shots data #166

Closed
rowzreport opened this issue Aug 18, 2022 · 8 comments
Closed

fotmob_get_match_details scrapes and unnests shots data #166

rowzreport opened this issue Aug 18, 2022 · 8 comments

Comments

@rowzreport
Copy link

rowzreport commented Aug 18, 2022

I am using the latest version: 0.5.12.1000. See below example and comments

#below function gives shot level data. 
#If I remember correctly (not 100% on this), it used to give main match info, and the last column was a shots dataframe. 
#it seems like the below function now just downloads the shots dataframe and unnests it
df1 = fotmob_get_match_details(3915296) ##sample matchid #1
df2 = fotmob_get_match_details(3932406) ##sample matchid #2

Output:

> head(df1[15:19])
# A tibble: 6 × 5
          id event_type   team_id player_id player_name  
       <dbl> <chr>          <int>     <int> <chr>        
1 2447448415 Miss            8655    820581 Ben Brereton 
2 2447450905 Goal            9798    789508 Tom McIntyre 
3 2447456503 AttemptSaved    9798   1123529 Tyrese Fornah
4 2447456983 AttemptSaved    9798    877567 Thomas Holmes
5 2447457197 Miss            9798    212441 Andy Yiadom  
6 2447457543 AttemptSaved    9798     23293 Shane Long   
@tonyelhabr
Copy link
Collaborator

Yes, this was a change in 0.5.8. See the NEWS.md

@tonyelhabr
Copy link
Collaborator

Yes, this was a change in 0.5.8. See the NEWS.md

The reasoning: most people were using this function for the shot data anyways, so unnesting for users is convenient.

@rowzreport
Copy link
Author

Yes I definitely agree that unnesting is super convenient and saves a lot of time.

However, fotmob_get_match_details currently scrapes only the shot data. I.e., with the current set of functions, (I believe) there is not a way to get basic match information including match score, stadium_name, referee_name etc. This used to exist with the old version of the function.

Having a simple function to get the basics, if it's not too much time consuming, would be super helpful,

@tonyelhabr
Copy link
Collaborator

But fotmob_get_match_details() didn't return match score, venue, referee, etc. before the unnesting change in 0.5.8. (All the same columns + the unnested shot columns are returned with the existing fotmob_get_match_details() .) Are you asking for a new function? It wouldn't be hard I suppose.

@rowzreport
Copy link
Author

Ok fair - I was not 100% sure that match score, venue etc. was returned from fotmob_get_match_details()

In that regard, yes it would be great to have a new function then!

@tonyelhabr
Copy link
Collaborator

Ok fair - I was not 100% sure that match score, venue etc. was returned from fotmob_get_match_details()

In that regard, yes it would be great to have a new function then!

I can work on it. I'll leave this issue open until it's done.

@tonyelhabr
Copy link
Collaborator

Addressed with #173

@rowzreport
Copy link
Author

Thank you!

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

No branches or pull requests

2 participants