Skip to content

Instantly share code, notes, and snippets.

View diogok's full-sized avatar

Diogo Souza da Silva diogok

View GitHub Profile
@diogok
diogok / couchdb.clj
Created August 17, 2010 12:35
couchdb.clj
(ns couchdb
(:use clojure.data.json)
(:refer-clojure :exclude [get key]))
(defn server
"Wraps a server"
[host port] {:server (str "http://" host ":" port)})
(defn db
"Wraps a database on a server"
(ns twitter-search
(:require [clojure.contrib.json.read :as json])
(:require [clojure.contrib.http.agent :as http ])
(:import (java.net URL URLEncoder))
)
(defn search [word last-id]
(let [term (URLEncoder/encode word "UTF-8")
result (http/string (http/http-agent (str
"http://search.twitter.com/search.json?q="
<?php
$mail = "email@gmail.com" ;
$header = "From: email@gmail.com\n" ;
$msg = "Mensagem" ;
$subject = "Assunto" ;
mail($mail,$subject,$msg,$header);
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.KeyGenerator;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
dofile("utils/http.lua")
dofile("utils/json.lua")
search = function(query)
local url = "http://en.wikipedia.org/w/api.php?action=query&list=search&format=json&srsearch=".. http.encode(query);
local headers = {
{
"User-Agent",
"AnySearch"
}