How to build a data mining web app?
github.com
github.com
I was attempting to write a crawler for a pretty big dynamic site. It worked, but the code ended up being so messy because of all the weird quirks I had to check for non-stop.
Basically, write a whole bunch of rules, fail safes, etc. So for a twitter crawler the tweet should always be there, the username should always be there, and the response should always be more than 400 characters.
Then any response that fails doesn't bring down your app, it just goes into the "needs review pile" and your app continues unless it gets 50 or so of these errors in a row. Then it SMSes or emails you to let you know it shut down.
It isn't like normal programming, it is dirty and any analysis you plan to do has to take the assumption that you will never get all of the data.
In terms of cleaner code, TDD will help here, but yeah, you will need dozens if not hundreds of methods while you're trying to classify a response.
I would have had to charge my users a lot of money to pay for the kind of scraping required to power my product.
I have ~100 visits per day. That costs me ~$0.10 per day.
More details here:
https://github.com/entaroadun/hnpickup/wiki/Hacker-News-Pick...
Denial Reason: Insufficient Text.
What happen to saying: "picture worth thousand words"?3.8 million data store reads for 8,000 visitors seems high. Especially for the kind of data you are serving - it's not rapidly changing.
Are you using memcache at all? A quick scan of the source doesn't show any memcache imports, but I just might've missed it. (http://code.google.com/appengine/docs/python/memcache/usingm...)
Probably the production version of the code will get memcache and some other features. Apart of couple suggestions from the discussion here the educational version of hnpickup will be frozen. Although, any simplifications or correction to the code or documentation are very welcome.
# Section Header
Paragraph text.
then GitHub will render it nicely.btbytes did the md formatting for me. I will accept the pull request as soon as I get home.
Is this normal?
EDIT: As I say in the "warning" section of the readme file: usually it's not a good idea to show the raw data because it will confuse the end user. And if you add more explanation you will cause clutter and cognitive overload. I show the raw data mostly for people that want to dig into the source code.
That said, what is a pickup ratio? Some sort of measure of extra votes over time?
Pickup ratio > 1 means that the "newest" page has couple very interesting stories that are also seen on the "news" page.
Pickup ratio > 2 means that there is some sort of hysteria on HN about some particular topic ...
#!/usr/bin/R-2.10/bin/Rscript
...
You can call R as a script. Wicked!Do you run this as a cron job, or is there some hook from python?
Google App Engine doesn't support R but you can use NumPy:
http://code.google.com/appengine/docs/python/python27/using2...
P.S. It seems like you're following me on GitHub. Makes me wonder if I know you. Email me to introduce yourself! :)