Skip to content

Instantly share code, notes, and snippets.

@klyr
Created April 5, 2020 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klyr/62482e282d1f6a36d382f2089eff5529 to your computer and use it in GitHub Desktop.
Save klyr/62482e282d1f6a36d382f2089eff5529 to your computer and use it in GitHub Desktop.
Remove all bookmarks
import requests
import bs4
my_recipes = 'https://cookidoo.fr/organize/fr-FR/my-recipes'
book = 'https://cookidoo.fr/organize/fr-FR/api/bookmark'
cookies = 'XXX'
while True:
print("===")
r = requests.get(my_recipes, headers={'Cookie': cookies})
soup = bs4.BeautifulSoup(r.text, 'html.parser')
recipes = soup.find_all("core-tile")
if len(recipes) == 0: break
for c in recipes:
r_id = c.get('data-recipe-id')
body = {"_method": "delete", "recipeId": r_id}
print(f"Deleting recipe {r_id}")
r = requests.delete(book, headers={'Cookie': cookies}, data=body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment