background preloader

Web Development

Facebook Twitter

I Don’t Need No Stinking API: Web Scraping For Fun and Profit | Hartley Brody. If you’ve ever needed to pull data from a third party website, chances are you started by checking to see if they had an official API. But did you know that there’s a source of structured data that virtually every website on the internet supports automatically, by default?

That’s right, we’re talking about pulling our data straight out of HTML — otherwise known as web scraping. Here’s why web scraping is awesome: Any content that can be viewed on a webpage can be scraped. Period. If a website provides a way for a visitor’s browser to download content and render that content in a structured way, then almost by definition, that content can be accessed programmatically. Over the past few years, I’ve scraped dozens of websites — from music blogs and fashion retailers to the USPTO and undocumented JSON endpoints I found by inspecting network traffic in my browser. Why You Should Scrape With APIs, you often have to register to get a key and then send along that key with every request. Export d3js/SVG as SVG/PDF. RESTful API Design: Teach a Dog to REST | Apigee.

UPDATED November 2011: Check out the second edition of the webinar - RESTful API Design. It's been 10 years since Roy Fielding first defined REST in his dissertation on Architectural Styles and the Design of Network-based Software Architectures. Since then, REST is often held as the standard for usable, well-designed, easy-to-integrate APIs. At the Cloudstock hackathon, I presented "Teach a Dog to REST," asking the question: where are all the elegant REST APIs we'd all hoped to see? While many claim REST has arrived, many APIs in the wild exhibit arbitrary, productivity-killing deviations from true REST. In this presentation, I start with a typical poorly-designed API and iterate it into a well-behaved RESTful API. Check out the presentation (with audio!) Slides + Audio: Architectural Styles and the Design of Network-based Software ArchitecturesSo, where are all the elegant REST APIs?

Simple example - Node.js, Restify, MongoDb and Mongoose - Backbone.js Tutorials. Before I start, the Backbone.js parts of this tutorial will be using techniques described in "Organizing your application using Modules to construct a simple guestbook. Getting started To easily understand this tutorial you should jump straight into the example code base. Example Codebase Example Demo This tutorial will assist you in saving data(Backbone.js Models) to MongoDb and retrieving a list(Backbone.js Collections) of them back. The technologies This stack is great for rapid prototyping and highly intuitive. Node.js "Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Restify "Restify is a node.js module built specifically to enable you to build correct REST web services. MongoDb "MongoDB (from "humongous") is a scalable, high-performance, open source NoSQL database. " Mongoose "Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment.

" Building the server Restify configuration Mongoose Schema. RESTful Web services: The basics. The basics REST defines a set of architectural principles by which you can design Web services that focus on a system's resources, including how resource states are addressed and transferred over HTTP by a wide range of clients written in different languages. If measured by the number of Web services that use it, REST has emerged in the last few years alone as a predominant Web service design model. In fact, REST has had such a large impact on the Web that it has mostly displaced SOAP- and WSDL-based interface design because it's a considerably simpler style to use. REST didn't attract this much attention when it was first introduced in 2000 by Roy Fielding at the University of California, Irvine, in his academic dissertation, "Architectural Styles and the Design of Network-based Software Architectures," which analyzes a set of software architecture principles that use the Web as a platform for distributed computing (see Resources for a link to this dissertation).

Back to top Listing 1. Web services - Understanding REST: Verbs, error codes, and authentication. CSS Style Guides. As we wrap up our recent poll on ordering CSS properties, it brings up the larger issue of CSS style guides. Ordering properties is just one choice you have to make that makes up a complete styling strategy. Naming is a part of it. Sectioning is a part of it. Commenting, indentation, overall file structure... it all makes up a complete CSS style guide. Let's round up some existing ones. But first... I love pattern libraries. The List I'll list some excerpts from each that I like below. GitHub GitHub CSS Style Guide → As a rule of thumb, don't nest further than 3 levels deep. Unit-less line-height is preferred because it does not inherit a percentage value of its parent element, but instead is based on a multiplier of the font-size. Google Google HTML/CSS Style Guide → Use ID and class names that are as short as possible but as long as necessary.

E.g. E.g. .demo-image not .demoimage or .demo_image Idiomatic CSS Nicolas Gallagher's Idiomatic CSS → Configure your editor to "show invisibles". ThinkUp. The leading open-source ajax web framework for Enterprise Java. 30 HTML Best Practices for Beginners.