Skip to content
This repository has been archived by the owner on Sep 8, 2022. It is now read-only.

Commit

Permalink
WiP
Browse files Browse the repository at this point in the history
  • Loading branch information
DFectuoso committed Jun 23, 2012
1 parent 83abb6a commit 15e4fde
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions web.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var express = require('express');
var oauth = require('oauth');
var sys = require('util');
var pg = require('pg');

var _twitterConsumerKey = "CnBeavwDfHUzYeOIPkvA";
var _twitterConsumerSecret = "PVdLn1eilJwnriAWI5euVIRfnqipZzfTtfAZs4TmY";
Expand Down Expand Up @@ -64,6 +65,15 @@ app.get('/sessions/callback', function(req, res){
req.session.oauthAccessTokenSecret = oauthAccessTokenSecret;
// Right here is where we would write out some nice user stuff
consumer().get("http://twitter.com/account/verify_credentials.json", req.session.oauthAccessToken, req.session.oauthAccessTokenSecret, function (error, data, response) {
pg.connect(process.env.DATABASE_URL, function(err, client) {
var query = client.query('INSERT INTO votes VALUES (3, \'DFect\');');

query.on('row', function(row) {
console.log(JSON.stringify(row));
});
});


if (error) {
res.send("Error getting twitter screen name : " + sys.inspect(error), 500);
} else {
Expand Down

0 comments on commit 15e4fde

Please sign in to comment.