|
|
/**
|
|
|
* 翻墙代理服务
|
|
|
*/
|
|
|
var express = require('express');
|
|
|
var request = require('request');
|
|
|
var fs = require('fs');
|
...
|
...
|
@@ -21,7 +24,10 @@ app.get('/',function(req,res) |
|
|
res.end(html);
|
|
|
});
|
|
|
|
|
|
|
|
|
/**
|
|
|
* facebook代理服务
|
|
|
* 获取信息
|
|
|
*/
|
|
|
var FB = require('fb');
|
|
|
app.get('/fb',function(req,res)
|
|
|
{
|
...
|
...
|
@@ -55,6 +61,10 @@ app.get('/fb',function(req,res) |
|
|
}
|
|
|
});
|
|
|
|
|
|
/**
|
|
|
* facebook代理服务
|
|
|
* 发送信息
|
|
|
*/
|
|
|
app.post('/fb',function(req,res)
|
|
|
{
|
|
|
var data = req.body.data;
|
...
|
...
|
@@ -71,7 +81,11 @@ app.post('/fb',function(req,res) |
|
|
});
|
|
|
});
|
|
|
|
|
|
app.get('fb/auth',function(req,res)
|
|
|
/**
|
|
|
* facebook代理服务
|
|
|
* 获取认证信息
|
|
|
*/
|
|
|
app.get('/fb/auth',function(req,res)
|
|
|
{
|
|
|
FB.api(req.param("method"),
|
|
|
req.params, function (resp)
|
...
|
...
|
@@ -81,7 +95,11 @@ app.get('fb/auth',function(req,res) |
|
|
});
|
|
|
});
|
|
|
|
|
|
app.post('fb/auth',function(req,res)
|
|
|
/**
|
|
|
* facebook代理服务
|
|
|
* 发送认证信息
|
|
|
*/
|
|
|
app.post('/fb/auth',function(req,res)
|
|
|
{
|
|
|
FB.api(req.body.method,
|
|
|
req.body, function (resp)
|
...
|
...
|
@@ -93,7 +111,10 @@ app.post('fb/auth',function(req,res) |
|
|
|
|
|
|
|
|
app.listen(80);
|
|
|
|
|
|
/**
|
|
|
* google代理服务
|
|
|
* 根据坐标获取地理信息
|
|
|
*/
|
|
|
app.get('/google',function(req,res)
|
|
|
{
|
|
|
request('http://maps.google.cn/maps/api/geocode/json'+req._parsedUrl.search, function (error, response, body)
|
...
|
...
|
|