Created
April 1, 2024 02:37
-
-
Save belkarx/c1234ea1589dee3d8ce58907cdf934bb to your computer and use it in GitHub Desktop.
find restaurants with free food near you
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def find_restaurants(latitude, longitude, radius=5000): # | |
Radius in meters | |
# Overpass query | |
overpass_url = "http://overpass-api.de/api/interpreter" | |
overpass_query = f""" | |
[out:json]; | |
( | |
node["amenity"="restaurant"](around:{radius},{latitud | |
e},{longitude}); | |
way["amenity"="restaurant"](around:{radius},{latitude | |
},{longitude}); | |
relation["amenity"="restaurant"](around:{radius},{lat | |
itude},{longitude}); | |
); | |
out center; | |
""" | |
response = requests.get(overpass_url, params={'data': o | |
verpass_query}) | |
if response.status_code == 200: | |
results = response.json().get('elements', []) | |
return [(restaurant.get('tags', {}).get('name'), re | |
staurant.get('lat'), restaurant.get('lon')) for restaurant | |
in results] | |
else: | |
return f"Error: {response.status_code}" | |
# Example usage | |
latitude = 40.7128 # Replace with your latitude | |
longitude = -74.0060 # Replace with your longitude | |
restaurants = find_restaurants(latitude, longitude) | |
for name, lat, lon in restaurants: | |
print(f"Restaurant: {name}, Latitude: {lat}, Longitude: | |
{lon}") | |
#scraped from random websites online, cleaned w chgpt-4 probably idr | |
birthday_offers = {'Ruby Tuesday': 'Free Garden Bar or burger entrée for So Connected members.', 'Smoothie King': 'Free birthday smoothie', 'Sonny’s BBQ': 'Free Big Deal Combo meal', 'Sprinkles': 'Free cupcake', 'Taco Bell': 'Free Mountain Dew Baja Blast Freeze', 'TCBY': 'Free ‘birthday treat’ (up to $5)', 'Texas Roadhouse': 'Free appetizer or sidekick of ribs/shrimp', 'The Cheesecake Factory': 'Free slice of cheesecake', 'The Melting Pot': 'Birthday voucher and six Signature Dipped Strawberries', 'TGIFridays': '‘Birthday surprise’', 'Tropical Smoothie Cafe': 'Surprise birthday reward', 'Uno Pizzeria & Grill': 'Birthday coupon', 'Wahlburgers': 'Free non-alcoholic shake', 'Wetzel’s Pretzels': 'Free Original or Sinful Cinnamon pretzel', 'Wienerschnitzel': '‘Free food’ on birthday', 'Wingstop': 'Free ‘birthday gift’', 'Zaxby’s': 'Free ‘birthday surprise’', 'AMC Theatres': 'Free large popcorn', 'Harkins Theatres': '$5 birthday coupon for concessions', 'Hard Rock': 'Surprise offer for Hard Rock Rewards members.', 'Redbox': 'Free movie rental for Play Pass members.', 'adidas': '‘Birthday gift’ after earning 1,000 points', 'Banana Republic': '‘Extra perks’ for birthday', 'Columbia': '‘Birthday gift’ from sportswear retailer', 'Designer Shoe Warehouse (DSW)': '$5 birthday reward', 'Famous Footwear': '$5 reward cash for Birthday Club members.', 'JCPenney': '‘Birthday gift’ for rewards members', 'Kohl’s': '‘Special birthday gift’ for rewards members', 'Old Navy': 'Surprise gift for newsletter subscribers.', 'Target': '5% off coupon on birthday for Circle members', 'Tilly’s': '‘Birthday surprise’ for rewards members', 'Torrid': '‘Special birthday gift’ for rewards members', 'Victoria’s Secret': '$10 birthday rewards, $15 for certain credit card members', 'Aveda': 'Free gift valued at $23 for Pure Privilege members with a purchase in the last 12 months and newsletter subscription.', 'Bath & Body Works': 'Free ‘birthday gift’ and additional rewards', 'Sephora': 'Free makeup samples for loyalty program members.', 'Ulta Beauty': 'Free birthday gift, additional coupon for Platinum/Diamond members', 'Ace Hardware': '$5 reward card for ACE Rewards members.', 'Barnes & Noble (Premium Membership)': 'Special offer for birthday', 'Build-A-Bear': '‘Special reward’ on birthday for Bonus Club members', 'CVS Pharmacy': '$3 Extrabucks reward on birthday', 'Disneyland': 'Free birthday dessert at Disney-themed restaurants', 'Swagbucks': '55 SB credit as birthday reward', 'World Market': '‘Surprise offer’ on birthday for Rewards members', 'Barnes and Noble': "Free cupcake for Kids' Club members.", 'bareMinerals': 'Free makeup samples for program members.', 'Hallmark': 'Free card and 20% off coupon for Crown Rewards members.', 'CVS': '$3 ExtraCare bucks for ExtraCare Beauty Club members.', 'Smashbox': 'Free beauty products for rewards program members.', 'ULTA Beauty': 'Free beauty products and double points for Ultimate Rewards members.', 'World Market Explorer': 'Surprise gift for members.', 'Medieval Times': 'Free dinner and tournament entertainment.', 'DSW': '$5 coupon ($10 for Elite members) for birthday club members.', 'Cobblestone Auto Spa': 'Free car wash.', 'Columbia Sportswear': '20% off coupon for members.', 'AMC': 'Free popcorn for AMC Stubs members.', 'Panera': 'Free pastry for MyPanera members.', 'P. F. Chang’s': 'Free appetizer or dessert for rewards members.', 'Red Lobster': 'Surprise gift for Fresh Catch club members.', 'Red Robin': 'Free burger for rewards program members.', 'Perkins': 'Free slice of pie for MyPerkins members.', 'Olive Garden': 'Free dessert for eClub members.', 'Chik-fil-A': 'Surprise reward for Chik-fil-A One app users.', 'Noodles World Kitchen': 'Free coupon for rewards program members.', 'Not Your Average Joe’s Kitchen and Bar': 'Surprise gift for email list subscribers.', 'Moe’s Southwest Grill': 'Free burrito for eWorld program members.', 'Joe’s Crab Shack': 'Surprise gift for Joe’s Catch program members.', 'First Watch': 'BOGO coupon for Sun eClub members.', 'Marble Slab': 'Ice cream surprise for Slab Happy email subscribers.', 'Krispy Kreme': 'Free donut for eClub members.', 'Jack in the Box': 'Free birthday tacos for registered users.', 'IHOP': 'Free meal for Pancake Revolution members.', 'Jersey Mike’s Subs': 'Free sub and drink for email club members.', 'Great American Cookies': 'Surprise gift for Cookie Club members.', 'Friendly’s': 'Free sundae for BFF Club members.', 'Denny’s': 'Free Grand Slam with ID proof on birthday.', 'Dairy Queen': 'BOGO Blizzards coupon for Blizzard Fan Club members.', 'Firehouse Subs': 'Free sub for Rewards members.', 'Don Pablo’s': '$10 gift card for Habaneros Members.', 'Fuddruckers': 'Surprise offer for Fudds club members.', 'Cracker Barrel': 'Free dessert, no sign-up required.', 'Cinnabon': 'Free Minibon for Club members.'} | |
for k in birthday_offers: | |
y = [x[0] for x in restaurants if x[0] and k.lower() in | |
x[0].lower()] | |
if y: | |
print(y) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment