Many to Many, 28th May [London, UK]
7 pointsby hafabnew3 comments
readinglvl = getReadingLevel(paragraphs, sentences, words, chars);
[..]
function getReadingLevel (p, s, w, c) {
var r = Math.round((4.75 * (c / w)) + (0.5 * (w / s)) - 21.43);
return r;
}
So it's a slightly modified http://en.wikipedia.org/wiki/Automated_Readability_Index (uses 4.75 instead of 4.71 . from lxml import etree
root = etree.XML(data)
urls = root.xpath(
'.//sitemap:loc/text()',
namespaces={
'sitemap': 'http://www.sitemaps.org/schemas/sitemap/0.9',
}
)
For RSS reading, here's a straightforward example. Obviously you can factor out the index access on each item, and calling `/text()` too. import urllib2
from lxml import etree
data = urllib2.urlopen('https://news.ycombinator.com/rss').read()
root = etree.XML(data)
for i, item in enumerate(root.xpath('.//item')):
print i, item.xpath('title/text()')[0]
print item.xpath('description/text()')[0]
print item.xpath('link/text()')[0]
print
All pretty simple, xpath selectors can get a bit gnarly at times though. The tradeoff being that you can be very expressive with them.
https://www.thread.com/jobs
We're a startup trying to reinvent retail so men can dress well without being subject to the horrors of the high street or having to trawl through millions of items online. We do this using a combination of powerful algorithms and human stylists.
You'd be joining a small, highly technical team with a ton of startup experience (the founders have started and sold 2 companies before). You'll be one of the first technical hires and get to build and own huge parts of the product and work on the core algorithms.
One of our ancillary goals is to build one of the best engineering cultures anywhere, and we'd love you to help us do that. We launched in October and user and revenue numbers are scaling extremely quickly. We're backed by a collection of the top investors from London and Silicon Valley as well as Y Combinator.
We're especially interested in people who are interested in founding their own startup one day. We view working at Thread as a founder bootcamp where you'll learn about all parts of starting and growing a startup.
Want to learn more? Check out https://www.thread.com/jobs and you can see some of our code at http://dev.thread.com/
Thanks!