使用CURL与oauth桌面沙发 [英] Using CURL with oauth for desktop-couch
问题描述
要访问 desktopcouch ,文档建议使用oauth。使用O'Reilly书中的示例CouchDB - 确定指南我想使用CURL(或其他命令行工具,如果适用)使用desktopcouch。我想我需要一个脚本来查询密钥存储检索oauth令牌并将其添加到CURL字符串。理想情况下,我想创建一个couchurl脚本文件,我可以使用,而不是CURL命令的书中的示例。
To access desktopcouch the documentation suggest to use oauth. Using the samples in the O'Reilly book "CouchDB - the definite guide" I want to use CURL (or another command line tool if appropriate) to work with desktopcouch. I guess I would need a script to query the key store to retrieve the oauth token and add it to the CURL string. Ideally I would like to create a couchurl script file that I can use instead of the CURL command for the samples in the book. How would that script look like?
推荐答案
你可以使用twurl:
http://thechangelog.com/post/536535280/twurl-oauth -enabled-curl-for-the-twitter-api
You can use twurl: http://thechangelog.com/post/536535280/twurl-oauth-enabled-curl-for-the-twitter-api
Twurl - Twitter API的OAuth启用卷轴
Wynn Netherland
Twurl - OAuth-enabled curl for the Twitter API Wynn Netherland
OAuth很酷,但使用OAuth开发可能会很痛苦。灵感来自curl和Hurl.it(在Leah Culver的第0.1版中进行了介绍),Twitter团队重新发布了一些工具,使使用Twitter OAuth API进行开发变得更加容易。
OAuth is cool but developing with OAuth can be a pain. Inspired by curl and Hurl.it (featured on Episode 0.1.5 with Leah Culver), the Twitter team has realeased a couple of tools to make developing with the Twitter OAuth API much easier.
Twurl是一个来自Marcel Molina的Ruby宝石,它允许您从控制台向Twitter OAuth API发出请求。要开始安装gem:
Twurl is a Ruby gem from Marcel Molina that lets you make requests to the Twitter OAuth API from the console. To begin install the gem:
$ sudo gem install twurl
然后从命令行(而不是Ruby控制台),您可以使用您的API密钥授权twurl:
Then from the command line (not the Ruby console) you can authorize twurl using your API keys:
$ twurl authorize - consumer-key the_key --consumer-secret the_secret
现在您可以向API方法发出请求:
Now you can make requests to API methods:
$ twurl /1/statuses/home_timeline.xml
Twitter团队还有在新的Twitter开发者网站上,可以在下拉菜单中预先填充您的Twitter应用程序。
The Twitter team also has a nifty GUI version up on the new Twitter Developers Site that even pre-populates your Twitter apps in a drop-down.
这篇关于使用CURL与oauth桌面沙发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!