This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* node.js/express twitter oauth integration sample | |
*/ | |
var express = require('express'), | |
connect = require('connect'); | |
var MemoryStore = require('connect/middleware/session/memory'); | |
var OAuth= require('oauth').OAuth; | |
var app = express.createServer(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'), | |
url = require('url'); | |
PROXY_VIA = 'CouchProxy'; | |
function debug(str){ | |
console.log(str); | |
} | |
exports.proxy = function(backendUrl){ | |
var backend = url.parse(backendUrl); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import sys | |
import json | |
import logging | |
import getopt | |
import couchdbkit | |
import json | |
import locale | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sys = require('sys'), | |
url = require('url'), | |
querystring = require('querystring'), | |
http = require('http'); | |
var logger = require('ext').logger; | |
function handleStream(request, callback){ | |
request.connection.on('error', function(err){ | |
logger.critical('[Twitter] Streaming failed.'); | |
logger.critical(err); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(doc){ | |
if( doc.type != "twitter" || doc.source == undefined ){ | |
return; | |
} | |
if( doc.source.text ){ | |
function hyperlink(text){ | |
return text.replace(/(https?:\/\/[^\s]+)/g, '<a class="hyperlink" href="$1" target="_new">$1</a>'); | |
} | |
function mentionlink(text){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Twitter Client for node.js | |
*/ | |
var sys = require('sys'), | |
url = require('url'), | |
querystring = require('querystring'), | |
http = require('http'), | |
crypto = require('crypto'), | |
EventEmitter = require('events').EventEmitter; | |
var OAuth = require('oauth').OAuth; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sys = require('sys'); | |
var EventEmitter = require('events').EventEmitter; | |
var MAX = 1000000; | |
var c = 0; | |
function doOnce(){ | |
require('assert').equal(c, MAX); | |
console.log('OK'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function copy(fileUrl, docUrl, event, trace){ | |
if( !trace ){ | |
trace = 0; | |
} | |
if( !trace ){ | |
event = new EventEmitter(); | |
} | |
if( trace == MAX_TRACE ){ | |
logger.error('Max trace exceeded. ({fileUrl} -> {docUrl})'.format({fileUrl: fileUrl, docUrl: docUrl})); | |
return undefined; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* retwis-js.js | |
* | |
* Description: | |
* | |
* redis tutorial program impelmented by node.js | |
* | |
* Usage: | |
* | |
* node redis.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************* | |
* Connect middleware to proxy request to | |
* the specified path on CouchDB. | |
* | |
* Usage: | |
* | |
* app.use(express.bodyDecoder()); | |
* app.use(function(req, res, next){ | |
* res.bindings = res.bindings || {}; | |
* }); |
OlderNewer