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 appPort = 3000; | |
var express = require('express'), app = express(); | |
var http = require('http') | |
, server = http.createServer(app) | |
, io = require('socket.io').listen(server); | |
var jade = require('jade'); | |
var pseudoArray = ['admin']; |
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 messageContainer, submitButton; | |
var pseudo = ""; | |
$(function() { | |
messageContainer = $('#messageInput'); | |
submitButton = $("#submit"); | |
bindButton(); | |
window.setInterval(time, 1000*10); | |
$("#alertPseudo").hide(); |
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 express = require('express'); | |
var path = require('path'); | |
var bodyParser = require('body-parser'); | |
var functions = require('./modular_functions'); | |
var app = express(); | |
app.set('views', path.join(__dirname, 'views')); | |
app.set('view engine', 'ejs'); |
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
{ | |
"name": "twitterSearch", | |
"version": "0.0.1", | |
"private": true, | |
"scripts": { | |
"start": "node ./app.js" | |
}, | |
"dependencies": { | |
"express": "~4.2.0", | |
"cookie-parser": "~1.0.1", |
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 T = new Twit({ | |
consumer_key: 'GzM2G202zP4Lo04kAFoP4TmEa' | |
, consumer_secret: 'aJBOMYk96ZUUriLtvhP0ecAuGmw9pN38xdj69iGaq8OZpk8R1f' | |
, access_token: '738778154458873857-p07JICMlD6NjtSOmOgamQrJYvTC6R2I' | |
, access_token_secret: 'E163HSitSwcZ3VDaqZqQuQ2Wviw0QqZULKsSH2655gRU1' | |
}); |
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
get_tweets = function (req, res){ | |
query = req.query.search; | |
var display_data = get_data.bind(res); | |
T.get('search/tweets', { q: query, count:100 }, display_data ); | |
} |
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 addMessage(msg, pseudo, date, self) { | |
if(self) var classDiv = "row message self"; | |
else var classDiv = "row message"; | |
$("#chatEntries").append('<div class="'+classDiv+'"><p class="infos"><span class="pseudo">'+pseudo+'</span>, <time class="date" title="'+date+'">'+date+'</time></p><p>' + msg + '</p></div>'); | |
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 messageContainer, submitButton; | |
var pseudo = ""; | |
$(function() { | |
messageContainer = $('#messageInput'); | |
submitButton = $("#submit"); | |
bindButton(); | |
window.setInterval(time, 1000*10); | |
$("#alertPseudo").hide(); |
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
io.sockets.on('connection', function (socket) { | |
users += 1; | |
reloadUsers(); | |
socket.on('message', function (data) { | |
if(pseudoSet(socket)) | |
{ | |
var transmit = {date : new Date().toISOString(), pseudo : socket.nickname, message : data}; | |
socket.broadcast.emit('message', transmit); | |
console.log(transmit['pseudo'] +" "+data+" yazdı"); | |
} |
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
app.get('/', function(req, res){ | |
res.render('home.jade'); | |
}); | |
server.listen(appPort); | |
console.log(appPort + " portu dinleniyor"); |
OlderNewer