Hacker Newsnew | comments | show | ask | jobs | submit | login

A shorter, more comprehensible version:

import requests

from bs4 import BeautifulSoup

from urlparse import urljoin

URL = 'http://philadelphia.craigslist.org/search/sss?sort=date&quer...

BASE = 'http://philadelphia.craigslist.org/cpg/'

response = requests.get(URL)

soup = BeautifulSoup(response.content)

for listing in soup.find_all('p',{'class':'row'}):

    if listing.find('span',{'class':'price'}):

        price = int(listing.text[2:6])

        if 100 < price <=250:

            print listing.text

            print urljoin(BASE, listing.a['href']) + '\n'

-----


Thanks for posting this, I am still very new to python and your website has taught me a lot. Appreciate the feedback.

-----


thanks

-----


Notice I never said "He should never be allowed to state his opinion." He's free to do so, and did. And in doing so made a public statement about his views. If you believe basic human rights should be denied to a group of individuals, I have an issue with that.

-----


I agree. I'm not being consistent in my views. I'm going to continue to use JavaScript, but I don't the Eich should be running Mozilla. Humans are complicated.

-----


Regardless of the merits of taking a public stand against this kind of thing, you, and the other people speaking out against Eich are making a Fundamental Attribution Error [0].

The fact that Eich donated in support of prop 8 does not necessarily make him a homophobe. The only thing we see is the donation and none of the context around what made him decide to do it. He has denied being a homophobe and there have been no reports of any homophobic behaviour. The only thing we actually know is that he made a donation to a political cause that the majority of the voting public also agreed with. Is it fair to say that every single one of the 52%[1] of voters in support of prop 8 are homophobes? Plainly the answer is no.

[0]: http://en.wikipedia.org/wiki/Fundamental_attribution_error [1]: http://en.wikipedia.org/wiki/California_Proposition_8_(2008)...

-----


I never accused him of being a homophobe, I simply stated all that I can glean from the facts: he doesn't believe homosexuals should be allowed to marry.

-----


So what? I know several homosexuals who don't believe homosexuals should be allowed to marry -- people who actually believe this is a regression to BS bourgeois values from gay people losing all perspective of 70's struggles (regarding liberation from antiquated values and institutions).

In general, taking a single issue and making it something people can lose their job over it, just because you have the power to push for it in the media, is very wrong.

At worse, what Brendan voted for would merely not let some gay people perform the same BS marital custom that straight people do. Doesn't compare at all to death penalty in my book --which costs hundrends of lives -- including of kids in places like Texas.

So, Should people who are in favor of the death penatly lose their job and have their CEO positions boycotted? Take you for example. What do you think about animal rights? Or the death penatly? Or gun control? Or drugs?

-----


> he doesn't believe homosexuals should be allowed to marry.

No, we cannot even infer this much, all we know is that he donated to a political cause. We know nothing else, can we stop the bullying now please?

-----


>Humans are complicated

Except Eich, who is some kind of one-dimensional figure, and should lose his CEO position because people don't agree with his personal opinions.

-----


jeff@jeffknupp.com please

-----


jeff@jeffknupp.com

-----


Sorry, seems like Disqus was serving up spammy ads along with the comments. I've disabled the ads.

-----


No worries, I want to read this after work, thanks for posting the information. I'll edit/update with any feedback.

-----


The goal was not to convince anyone that they needed to use a web framework. Rather, I hoped to explain to novices exactly what a web framework is and what problems it solves.

-----


Checkout sandman: www.sandman.io or www.github.com/jeffknupp/sandman

-----


ZeroMQ takes care of the queueing. Though I didn't delve into it in depth in this example, you can create quite sophisticated broker-less distributed systems pretty easily with ZeroMQ.

-----


Right, I understand that ZeroMQ is used to send and receive messages, what I mean is that there's no persistency involved so the tasks will not survive a system restart.

-----


No, I mean ZeroMQ takes care of the underlying queue for free (there is an underlying set of queues, which can be persisted if necessary)

-----


No, it doesn't, although it might be possible to sort of emulate it by setting ZMQ_HWM to 1 and enabling ZMQ_SWAP, but I wouldn't bet on it.

The best you can hope is to use the Titanic Service Protocol and just throw data into some sort of disk store. I've looked into doing this, but I settled on using RabbitMQ instead for persistence. Unless you're dealing with more than 10k messages a second, it's just as easy as ZeroMQ.

After a few months of experimenting, I've come to the conclusion that some combination of ZeroMQ and RabbitMQ is likely the easiest solution currently for a combination of low-overhead distributed messaging and broker-assisted persistent messaging.

-----


That must be a very recent development for 0mq then, do you have any source for this new feature?

-----


Are you thinking of RabbigMQ perhaps?

-----


Pickle (or any use of eval) is a security risk only if you're using it in the context of untrusted code. Basically any distributed task queue is going to have that risk if it can execute arbitrary code.

-----


I thought the risk was if the data came from an untrusted source, as it might contain code?

-----


I think shooting it over the network is considered untrusted. Man in the middle becomes a problem.

-----

More

Applications are open for YC Summer 2015

Guidelines | FAQ | Support | API | Lists | Bookmarklet | DMCA | Y Combinator | Apply | Contact

Search: