只是分享我在测试我的应用程序时遇到的一些信息.
Facebook Graph API实现了速率限制,如其文档页面所述.今天我试图从CNN facebook页面检索提要,我得到以下500错误:
{"error":{"code":1,"message":"Please reduce the amount of data you're asking for, then retry your request"}}
这是我试图测试的查询:
https://graph.facebook.com/v2.3/5550296508/feed?fields=id,actions,application,caption,created_time,description,from,icon,is_hidden,link,message,message_tags,name,object_id,picture,place,privacy,properties,source,status_type,story,story_tags,to,type,updated_time,with_tags,shares,likes.limit(50),comments.filter(stream).limit(50){attachment,created_time,from,id,like_count,message,message_tags,comments{attachment,created_time,from,id,like_count,message,message_tags}}&access_token=xxxxxxx
facebook http rate-limiting http-status-code-500 facebook-graph-api
我已经找到了答案,我相信答案很简单,但我找不到它.我认为我缺乏对nginx的了解......
我的nginx实例在localhost:8080上运行,我的Bottle服务器在localhost:8081上运行.如果我从浏览器打开地址,它们工作正常,但当我尝试从我在localhost:8080上运行的应用程序访问时,我无法检索Bottle服务器生成的资源.
我需要做的是将对/ data/path的所有调用重定向到同一个域(localhost),而将另一个端口(8081)重定向到我的瓶子服务器正在监听的端口.
这是代码:Nginx:
server {
listen 8080;
server_name localhost;
root /Users/Diego/Desktop;
location / {
index index.html index.htm;
}
location /data/ {
proxy_pass http://127.0.0.1:8081;
}
}
Run Code Online (Sandbox Code Playgroud)
瓶子服务器:
@route('/')
def printtest():
print 'success'
return 'loaded page'
@route('/<scenename>/data/<filename:path>')
def testMethod(scenename,filename):
print scenename, filename
run(host='localhost', port=8081, debug=True)
Run Code Online (Sandbox Code Playgroud)
在浏览器中调用localhost:8080,显示通过nginx提供的页面,但是,如果我调用链接来检索存储在/data/directory/filename.json中的内容,则Bottle似乎不会收到请求.错误日志指出:
2013/04/16 18:50:52 [error] 3544#10612: *69 CreateFile() "C:/Users/Diego/Desktop/project1/data/directory/directory-varietal.json" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: localhost, request: "GET /project1/data/directory/directory-varietal.json HTTP/1.1", host: "localhost:8081", referrer: "http://localhost:8080/project1/"
Run Code Online (Sandbox Code Playgroud)
任何人都可以告诉我如何处理这种重定向/路由?
另外,有没有办法在nginx的日志中打印Feed?像命令print_entry或类似?
谢谢!
编辑:我试过这个但没有结果...... https://serverfault.com/questions/208656/routing-to-various-node-js-servers-on-same-machine
编辑:好一些改进,我发现可能是查询位置的问题.使用此块并请求.json文件,它实际上查询Bottle服务器. …
有没有办法从Linkedin上公司页面的URL中获取数字公司ID?这个ID是我用来查询Linkedin API并获得有关该公司的更多信息的ID。 我需要从URL附带的信息中获取ID,然后使用它来获取与公司页面相关的其余信息。
在我看来,您需要挖掘HTML代码以获取需要用于使用Linkedin API进行交互的公司ID的做法对我来说似乎很不寻常,所以如果我错了,请纠正我。
我知道有类似的请求处理程序,但是我想知道为什么没有可用的处理程序来获取公司ID,就像从其url中获取配置文件ID一样:
https://api.linkedin.com/v1/people/url=xxxx
我知道有搜索公司的处理程序,但这是一项基于文本的研究,我发现自己有时会得出一些不一致的结果。
我不想为ID搜寻公司页面,因为如果我从同一个IP中进行了太多次访问,我就被Linkedin列入了黑名单。
我知道以下答案:
但它们似乎与我的要求过时或略有关系,并且由于LI API在过去一年中发生了很大变化,因此是否有任何进展。
编辑:添加了更多有关我正在寻找的ID种类的信息。我错误地将@display的答案标记为正确,但不幸的是,这不是我想要的。我这里指的是companyId,我会用它来查询有关该公司的LinkedIn的API。