• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

evz/tacofancy-api: Making an API for https://github.com/sinker/tacofancy

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

evz/tacofancy-api

开源软件地址:

https://github.com/evz/tacofancy-api

开源编程语言:

Python 91.3%

开源软件介绍:

TacoFancy API

Making an API for https://github.com/sinker/tacofancy

Main endpoint

The main endpoint for the API exists at:

http://taco-randomizer.herokuapp.com/

Visiting that page will also get you a random taco.

Use this data

If you’d like to take advantage of the API that was put together for this, I added a CORS header to these paths so that you can load them from a javascript app anywhere on the internet.

Random Taco

Visiting:

/random/

will get you a random Base Layer, Mixin, Condiment, Seasoning and Shell. To just get a random full taco recipe, call it thusly:

/random/?full-taco=true

Contributors

If you’d like to get info about the contributors for a certain recipe, you can call this endpoint:

/contributors/:recipe_type/:recipe_slug/

So to get the contributors for the Delengua (Beef Tounge) Base Layer, do this:

/contributors/base_layers/delengua_beef_tongue

Valid layer types are: base_layers, mixins, seasonings, condiments and shells. To get a mapping of slugs for a given recipe type call this:

/contributors/:recipe_type/

Contributions

If you’d like to see who has made what contributions to which recipes, call this:

/contributions/:github_username/

So, to get all of Dan Sinker’s contributions, call this:

/contributions/sinker/

To get a listing of all contributors and their usernames, call:

/contributions/

Want to help?

This whole this is a relatively rudimentary Flask setup. After you pip install the requirements, you should be able to visit /cook/ to get a DB together. The Flask app is looking for an environmental variable DATABASE_URL to tell it how to connect to the database. Depending on what backend you’re using, you might need to actually create the database, etc before it’ll work. I developed this with sqlite but you should be able to use any backend that SQLAlchemy supports.

You’ll also need to set GITHUB_TOKEN as an environment variable. This is a OAuth Token for the Github API. You can read more about how to get that going here




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap