Pure CSS3 calculator

This calculator works purely with CSS (no JavaScript on this page). Read here about the logic behind the application and how it works.

Ouch, looks like your browser doesn’t support the CSS function calc().
Currently known browsers to support it are Firefox 4.0, Chrome and Internet Explorer 9.0.

You can read about this application and how it works here.


Original URL: http://feedproxy.google.com/~r/feedsapi/BwPx/~3/nJt4qgIkHRU/

Original article

Osmosis: Web scraper for Node.js


Readme.md

HTML/XML parser and web scraper for NodeJS.

Features

  • Fast: uses libxml C bindings
  • Lightweight: no dependencies like jQuery, cheerio, or jsdom
  • Clean: promise based interface- no more nested callbacks
  • Flexible: supports both CSS and XPath selectors
  • Predictable: same input, same output, same order
  • Detailed logging for every step
  • Precise and natural IO flow- no setTimeout or process.nextTick
  • Easy debugging with built-in stack size and memory usage reporting
  • Memory leak free

Example: scrape all craigslist listings

var osmosis = require('osmosis');

osmosis
.get('www.craigslist.org/about/sites') 
.find('h1 + div a')
.set('location')
.follow('@href')
.find('header + div + div li > a')
.set('category')
.follow('@href')
.find('p > a', '.totallink + a.button.next:first')
.follow('@href')
.set({
    'title':        'section > h2',
    'description':  '#postingbody',
    'subcategory':  'div.breadbox > span[4]',
    'date':         'time@datetime',
    'latitude':     '#map@data-latitude',
    'longitude':    '#map@data-longitude',
    'images[]':     'img@src'
})
.data(function(listing) {
    // do something with listing data
})

Install

npm install osmosis

Documentation

For documentation and examples check out https://github.com/rc0x03/node-osmosis/wiki

Dependencies


Original URL: http://feedproxy.google.com/~r/feedsapi/BwPx/~3/p3JXRp9YpWc/node-osmosis

Original article

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑

%d bloggers like this: