Skip to content

Instantly share code, notes, and snippets.

#!/usr/local/bin/perl --
use strict;
use warnings;
use URI;
use Web::Scraper;
use YAML;
my $endpoint = 'http://movapic.com/hoge/follower?max=9999';
var Pool = function (name, value) {
var self = arguments.callee;
if ( typeof self.stash == "undefined" ) self.stash = {};
if ( Boolean(name) === false ) return false;
var item = self.stash[name];
if ( typeof value == "undefined" ) delete self.stash[name];
if (value) self.stash[name] = value;
# $username, $password, $status は適宜変更しよう。
# $status は投稿前に urlencode するとかしましょう。
# 超手抜き。
$c = curl_init("http://{$username}:{$password}@twitter.com/statuses/update.xml?status={$status}");
curl_setopt($c, CURLOPT_POST, 1);
curl_exec($c);
curl_close($c);
#!/usr/local/bin/perl
use strict;
use warnings;
use URI;
use IO::Socket;
use MIME::Base64;
use JSON::Syck;
#!/usr/local/bin/perl --
use strict;
use warnings;
use JSON::Syck;
use LWP::UserAgent;
my $agent = LWP::UserAgent->new;
my $a = shift or die;
#!/usr/local/bin/perl --
use strict;
use warnings;
use Web::Scraper;
use HTML::TreeBuilder::LibXML;
sub get_data {
my $endpoint = URI->new(qq!http://ladio.net/list/!);
<html>
<head>
<script type="text/javascript">
<!--
var $ = function (id) { return document.getElementById(id); };
window.onload = function () {
var images = $('image-list').getElementsByTagName('img');
for ( var i = 0; i < images.length; i++ ) {
<?php //>
$item = "hoge";
$values = array(
array(
'id' => 1,
'title' => 'title1',
),
array(
'id' => 2,
'title' => 'title2',
@aerith
aerith / app.rb
Created November 27, 2009 09:23
#!/usr/bin/ruby
require 'rubygems'
require 'sinatra'
require 'haml'
require 'pathname'
get '*' do
base = Pathname.new(File.dirname(__FILE__)).parent
path = @params[:splat].first.gsub(/^\//, '')
<?xml version="1.0" encoding="UTF-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="600" height="400" paddingLeft="0" paddingTop="0" paddingBottom="0" paddingRight="0" creationComplete="creationCompleteHandler()">
<mx:Script>
<![CDATA[
import mx.binding.utils.BindingUtils;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLVariables;
import mx.collections.XMLListCollection;