TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Finding Free Food with Python

278 pointsby jamesbvaughanabout 8 years ago

16 comments

dheeraabout 8 years ago
So "back in the day" when I was an undergrad at MIT I signed up for every mailing list I could get myself onto and then trained a Bayesian spam filter to recognize free food emails. I threw all free-food e-mails in a freshly-untrained spam box and sure enough, after a few hundred e-mails it kept putting free food e-mails in one folder which was extremely convenient. Spamicity (i.e. free-food-icity) for phrases like "bring spoon" and "thesis defense" were particularly high.
评论 #13809786 未加载
评论 #13809403 未加载
评论 #13815317 未加载
评论 #13809120 未加载
dansoabout 8 years ago
I&#x27;ve been wanting to make my students do, as a side project, a free-food searcher for Stanford. Wouldn&#x27;t have to be hard at all: Download (or even wget) the CS&#x2F;Engineering calendar, do the minimal scraping needed to figure out if the words &quot;food&quot;, &quot;meal&quot;, &quot;dinner&quot;, &quot;will be served&quot; &quot;refreshments&quot; appear anywhere in the text, then return True.<p>That&#x27;s the main thing, the rest is just gravy: returning the event serialized as JSON&#x2F;CSV (event name, date&#x2F;time, URL) to be used in a web app or notification system -- so a simple web scraper can lead to exploring web dev (even just a simple Flask app) or fun APIs like AWS SNS and Twilio. You could even fit in a good &quot;cache invalidation is a hard problem&quot; lesson.<p>I never get around to assigning it because most people don&#x27;t think of it as &quot;serious work&quot;. Also, I&#x27;m afraid the CS dept. will obfuscate their calendar if random people start showing to things for free food. But I keep telling students, the only&#x2F;best way to learn coding is to do something that directly affects your life or your bottom-line. It&#x27;s the best way to put constraints on a project, i.e. think of things as the MVP that improves your life.<p>I learned Ruby and Ruby on Rails much faster than I had any right to, when my new job in NYC required it. I practiced not by writing Ruby on the job, but writing Ruby to scrape Craigslist apartment listings and feeding them into a spreadsheet.<p>I&#x27;ve thought about creating &quot;personal data&#x2F;programming projects&quot;...in which the data comes from the student. Such as the SQLite that stores their Chrome&#x2F;Firefox&#x2F;Safari history. Or the parseable HTML dump that Facebook gives you when you request your records. Or your Twitter data dump. Or your Google search history.<p>But I&#x27;ve been reticent to do this. Partly because it&#x27;s not a guarantee that every student uses Google or Facebook or has an Instagram. And partly because I&#x27;m deeply paranoid students (especially those who are novices about programming and operating systems) will accidentally upload or otherwise expose this sensitive data dump.
评论 #13810074 未加载
评论 #13811889 未加载
评论 #13813868 未加载
评论 #13809460 未加载
评论 #13814428 未加载
TeMPOraLabout 8 years ago
I wonder how do those &quot;free food&quot; promotions make sense, business-wise. As this article shows, by doing such promotion you hit a completely different (and useless for you) clientbase - people just waiting for the promotions. This feel similar to the way most people seem to use Groupon - they&#x27;re interested in using what&#x27;s currently on big discount, and they won&#x27;t be coming back to a place when it&#x27;s on its regular pricing.
评论 #13809399 未加载
评论 #13809468 未加载
评论 #13809347 未加载
评论 #13809577 未加载
评论 #13809285 未加载
评论 #13810390 未加载
评论 #13809665 未加载
guakaabout 8 years ago
Finding free food with PHP: <a href="http:&#x2F;&#x2F;trashwiki.org&#x2F;en&#x2F;Main_Page" rel="nofollow">http:&#x2F;&#x2F;trashwiki.org&#x2F;en&#x2F;Main_Page</a>
评论 #13809618 未加载
DerJacquesabout 8 years ago
Great read that shows how web scarping can easily be utilised in a meaningful way.<p>However, doesn&#x27;t this script either send out the same text very often, or potentially send it out too late (by e.g. only letting the cronjob run every 6 hours)?<p>I assume that time is of the essence in this situation. Some sort of log on sent texts would surely be helpful.
评论 #13809053 未加载
tedmistonabout 8 years ago
Cool project. I do something similar for the daily free ebook from Packt. Also for when new episodes of Silicon Valley are posted.<p>Tiny detail - you can do the regex match case insensitive and avoid the call to lower() for every string.<p><pre><code> re.match(..., re.I)</code></pre>
评论 #13809818 未加载
评论 #13809249 未加载
评论 #13809040 未加载
t0mkabout 8 years ago
I wonder how difficult would it be to do this with cloud services, I mean to scrape voucher codes for free credit. For instance when Digital Ocean announces some promo and you can get 10 USD worth of credit.<p>There are some sites that allegedly publish coupons, but I feel like a dummy only scrolling through those, it&#x27;s full of ads and crap.<p>What would be the proper channels to scrape for promo codes of the cloud providers? Twitter feeds, something else?
评论 #13809706 未加载
canrememberabout 8 years ago
If you&#x27;re interested in free food, I recommend checking out www.freefoodguy.com. He&#x27;s a blogger who&#x27;s sole mission in life seems to be finding free food deals and sharing them via his email list.
tobilarscheidabout 8 years ago
Regarding free food you could also try natched:<p><a href="https:&#x2F;&#x2F;natched.com" rel="nofollow">https:&#x2F;&#x2F;natched.com</a><p>Disclaimer: I helped building this.
akeckabout 8 years ago
This automation will increase the consumption of free food offers by removing friction. Restaurants will not make money on their promotions, since the script users will only consume the free food in their local market. Restaurants will stop using free food promotions. ;-D
abbiyaabout 8 years ago
<a href="https:&#x2F;&#x2F;gist.github.com&#x2F;mseshachalam&#x2F;b57907a37763532917fc2ca79e4d5b77" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;mseshachalam&#x2F;b57907a37763532917fc2ca...</a><p>cloudflare captcha is blocking me to test this.
评论 #13810613 未加载
chris_chan_about 8 years ago
Haha, very nice. I think this might works with <a href="https:&#x2F;&#x2F;www.groupon.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.groupon.com&#x2F;</a> too.
robertcoreyabout 8 years ago
i dunno how well this would work in practice, in my experience signing up for promotional email results in tons of junk emails with actual deals only offered occasionally. It&#x27;d be hard to parse out real value
ing33kabout 8 years ago
postmates uses cloudflare and it may show a captcha page sometimes .
gandutravelerabout 8 years ago
New User = Free Food
mastheadabout 8 years ago
This is so easy, I wonder how it made all the way up to the front page.<p>I write these kind of mini-scripts all the time
评论 #13809542 未加载
评论 #13809539 未加载