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

Food.com URL Changes #338

Open
1 of 2 tasks
tommybbq opened this issue Jul 1, 2024 · 0 comments
Open
1 of 2 tasks

Food.com URL Changes #338

tommybbq opened this issue Jul 1, 2024 · 0 comments

Comments

@tommybbq
Copy link

tommybbq commented Jul 1, 2024

I'm submitting a

  • bug report.
  • feature request.

Current Behaviour:

Food.com has changed the URI for each recipe by moving from straight id to hyphenated name then id, so the tutorial site needs to be changed.

example:
old url: https://www.food.com/recipe/164636
new, working url: https://www.food.com/recipe/1-1-1-tempura-batter-164636

It's easy to fix in the notebooks:

create column 'hyphen' that converts spaces to hyphens in the 'name' column

df['hyphen'] = df['name'].str.replace(' ', '-')

create column 'newID' that concatenates 'id' and 'hyphen' columns

df['newID'] = df['hyphen'] + '-' + df['id'].astype(str)

drop id and hyphen columns

df = df.drop(columns=['id', 'hyphen'])

rename newID column to id

df = df.rename(columns={'newID': 'id'})

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

1 participant