background preloader

cURL - Tutorial

cURL - Tutorial
cURL Docs Tutorial HTTP Scripting 1.1 Background1.2 The HTTP Protocol1.3 See the Protocol1.4 See the Timing1.5 See the Response 2.1 Spec2.2 Host2.3 Port number2.4 User name and password2.5 Path part Fetch a page HTML forms 4.1 Forms explained4.2 GET4.3 POST4.4 File Upload POST4.5 Hidden Fields4.6 Figure Out What A POST Looks Like HTTP upload HTTP Authentication 6.1 Basic Authentication6.2 Other Authentication6.3 Proxy Authentication6.4 Hiding credentials More HTTP Headers 7.1 Referer7.2 User Agent Redirects 8.1 Location header8.2 Other redirects Cookies 9.1 Cookie Basics9.2 Cookie options 10.1 HTTPS is HTTP secure10.2 Certificates Custom Request Elements 11.1 Modify method and headers11.2 More on changed methods Web Login 12.1 Some login tricks Debug 13.1 Some debug tricks References 14.1 Standards14.2 Sites 1. 1.1 Background This document assumes that you're familiar with HTML and general networking. Curl is not written to do everything for you. 1.2 The HTTP Protocol The client, curl, sends a HTTP request. or 3.

Open learning initiative At Harvard Extension School, free and open learning is hardly a new concept. In fact, the Extension School was founded with this mission in mind: to create an affordable way for any motivated student to take courses at Harvard. We stay true to this mission today, offering several free courses and nearly 800 for-credit courses at reasonable tuition rates. Explore our series of free or low-cost courses below. In addition, you can also browse Harvard University's Digital Learning Portal, which features online learning content from across the University, both free and fee-based options. Video accessibility. Abstract Algebra In these free videotaped lectures, Professor Gross presents an array of algebraic concepts. The Ancient Greek Hero American Poetry from the Mayflower through Emerson Discover how the United States developed its own national literature with Elisa New, Powell M. Watch a video, in which Elisa New discusses the design of the HarvardX course and the topics covered. Bits China

Perl Hash Howto This how-to comes with no guaratees other than the fact that these code segments were copy/pasted from code that I wrote and ran successfully. Initialize a hash Assigning an empty list is the fastest way. Solution my %hash = (); Initialize a hash reference For a hash reference (aka hash_ref or href), assign a reference to an empty hash. my $hash_ref = {}; # ref will return HASH The great thing about this is that if before performing an actual assignment, you want to determine (using the ref operator) the type of thingy that a reference is pointing to, you can!... Note If you treat the variable just as any scalar variable; and use the my declaration alone, or assign a value, ref will return the empty string. my $hash_ref; # not a hash ref!... Clear (or empty) a hash If you literally want to empty the contents of a hash: for (keys %hash) { delete $hash{$_}; } Clear (or empty) a hash reference for (keys %$href) { delete $href->{$_}; } Example #! Output Add a key/value pair to a hash Hash: Hash reference: Hi!

Command Line Tutorials - Curl Hey everybody! Welcome back to my ongoing command line series. Check out the older posts here. This week we're going to cover one command in depth, since it's a pretty important one. We're going to learn about curl, and if time permits - curling! Curl is "a command line tool for getting or sending files using URL syntax." man curl As we've previously learned, most commands that come with your system have what's called a "man" page, short for manual; by typing in that command, you've opened the system's help page for the curl command. So to see it in action, type: curl Oops! curl | tidy -i This passes curl's output into a command we haven't seen before: tidy. tidy will nicely format any code we pass to it, and it's configurable to boot (check out the man page!). curl | pbcopy Here, we're feeding the response retrieved by curl into another new command, pbcopy. curl >> ~/google.txt That's all for today!

Typechart – Browse Web Type, Grab CSS. Perl Regular Expressions Troubleshooters.Com and Code Corner Present Copyright (C) 1998-2001 by Steve Litt Without regular expressions, Perl would be a fast development environment. Probably a little faster than VB for console apps. Regular expressions is a HUGE area of knowledge, bordering on an art. Regular expressions are a syntax, implemented in Perl and certain other environments, making it not only possible but easy to do some of the following: Complex string comparisons $string =~ m/sought_text/; # m before the first slash is the "match" operator. Simple String Comparisons The most basic string comparison is $string =~ m/sought_text/; The above returns true if string $string contains substring "sought_text", false otherwise. $string =~ m/^sought_text/; Similarly, the $ operator indicates "end of string". $string =~ m/sought_text$/; Now, if you want the comparison to be true only if $string contains the sought text and nothing but the sought text, simply do this: $string =~ m/^sought_text$/; . Other Quirks . is

Getting list of tags for a user from google reader api Starkers HTML5 « Nathan Staines Update: Unfortunately I'm no longer able to maintain and/or update Starkers HTML5 although you can still get a copy from GitHub and use it in its current state. Alternatively I'd suggest downloading the original Starkers recently updated by Viewport Industries or the underscores theme by Automattic. It's been roughly 2½ years since Elliot Jay Stocks first released Starkers, a completely naked Wordpress theme for designers and developers to build on. Like so many others I found Elliot's theme invaluable, and so about 7 months ago I decided to create an HTML5 version that others would be able to use. Starkers is a bare bones WordPress theme created to act as a starting point for the theme designer... With the introduction of Wordpress 3.0 I'm pleased to unveil the new version of Starkers HTML5, just like the previous version this one has been based on Elliot's Starkers, which in turn was based on the new default theme known as Twenty Ten. So what's new? Final notes

python script for starring and liking google reader items from exported json (used to migrate starred and liked items), check for web app version. #! python2 # Gaute Hope <eg@gaute.vetsj.com> 2011 # Note: This script was only made to serve its purpose one time, and is not # necessarily very user friendly. But have been used with success migrating # Google Reader data to a Google Apps account. # Stars and likes items in Google Reader, used to migrate starred # and liked items from old account to new. # transferred using OPML, json acquired using the export functionality # on original account. # First: Create a secret API key for this application. # provided as a service, but run stand alone, you are the provider # and need a secret key! # See: # This does work on Google Apps, but enable the Webmaster Tools # Service and add service (domain) and generate key through there. # Store key in file oauth_key and secret in file oauth_secret (or edit # script below). # Place files: # - starred-items.json # - liked-items.json # in same folder as script and run with python2. # to this program for your account. print

70 New, Useful AJAX And JavaScript Techniques | Developer&#039;s Advertisement As the Web grows and becomes more dynamic, more and more websites have user-generated content and tools that greatly improve the user experience in terms of usability and accessibility. Interactive solutions for lightboxes, form validation, navigation, upload, auto-complete, image cropping, slideshows, tool tips, sliders and tables are being developed that use nifty JavaScript and AJAX scripts. When using these, developers have to carefully consider many subtle techniques to help users get things done. In this article, we present 70 new and useful JavaScript and AJAX techniques, all of which are of the highest quality and are more or less easy to configure. jQuery, MooTools, Prototype and script.aculo.us are used in these examples, so every taste gets its due. 1. Timeframe A click-and-drag timeframe, with a function for defining ranges. Dateslider This element enables you to pick dates with a simple slider bar. 2. 3. 4. 5. 6. 7. 8. 9. 10. Proto! 11. 12.

askedrelic/libgreader Rock-Solid WordPress 3.0 Themes using Custom Post Types The WordPress community is buzzing with excitement over the soon-to-be-released WordPress 3.0. Currently in Beta 2 now, WordPress 3.0 will have a lot of exciting new features , such as a new default theme and better menu management. Quite possibly the most exciting of these features is custom post types. In this tutorial, we'll talk about creating and using custom post types to make a rock-solid theme. What is a Custom Post Type? Well, according to the WordPress Codex: "Post type refers to the various structured data that is maintained in the WordPress posts table. Essentially, it allows us developers to make new kinds of posts similar to the post and page types, which all appear in the main navigation in the WordPress admin. Let's Get Started! In this tutorial we will: Create a Custom Post Type for Products with our own inputsCreate a custom "taxonomy" for the type.Create a theme template to go along with the new type. Register the Custom Post Type Adding Our Own Inputs Wrapping Up

Andy's Blog: How to Build an OAuth Consumer I just read a magnificent blog post from Joseph Smarr over at Plaxo that inspired me to share some of my experiences in helping to build and test TripIt's OAuth protected API. I've written this post as a guide that lets you manually walk through all of the steps an OAuth consumer must implement in order to be able to make authenticated calls to TripIt's API. At each step of the process I've referenced a set of command line utilities that you can use to run through the examples as well as explanations for what those utilities are doing under the covers. All of these utilities can be found in TripIt's Python binding/wrapper library here: The Python binding for the TripIt API is actually a complete OAuth consumer implementation in addition to a convenient wrapper for the TripIt API. Also, please note that the discussion is very TripIt focused. Alice: I would like to develop a TripIt application. oauth_nonce

Related: