TheCocktailDB.com - An Open Cocktail Database with API - Printable Version
+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (/forumdisplay.php?fid=33)
+--- Forum: Meta-Data provider and Artwork Packs (/forumdisplay.php?fid=71)
+--- Thread: TheCocktailDB.com - An Open Cocktail Database with API (/showthread.php?tid=235298)
TheCocktailDB.com - An Open Cocktail Database with API - zag - 2015-08-14 10:49
Just another project I have been messing around with for a few years and never really released...
What is it?
Its an open online database of cocktail recipes. There are many other sites online but none offered a nice API, so I wrote one myself
How to use it with Kodi?
You don't yet... but there is a very simple JSON API that any developer can use to write a simple add-on. The vision is to be able to use Kodi in my kitchen/bar area to look up cocktail recipes with the remote. Hopefully a developer will jump on board and write the add-on (*Cough* Enen if you want a new project ).
Many years ago there was a plugin for Meedio called the barback script. It had lots of cocktail recipes and I missed it. I also have a big bar in my apartment
The online site can currently only accept user images. Adding new cocktails may come in the future depending on demand. I've already imported a load of them. There are also a load of missing ingredient pictures but I will add those over time.
How can I help?
At the moment, try uploading pictures of the cocktails you make. There are 3,000+ cocktails that need images 700x700 pixels in size.
I might introduce food recipes at some point which could be very cool for a kitchen based HTPC.
RE: TheCocktailDB.com - An Open Cocktail Database with API - zag - 2015-08-14 10:50
These examples use the test Api key of "1". Please post if you want your own key for larger projects. The test key may be removed at any time if it's abused.
Image name corresponds to returned API ingredient name exactly
NOTE: If you have a finished project, you will need an API key, please PM me or post in this thread or email me at zag (at) kodi.tv
RE: TheCocktailDB.com - An Open Cocktail Database with API - zag - 2015-08-18 16:27
Added loads of drink images myself for the most popular cocktails.
Nobody else interested in drinking?
RE: TheCocktailDB.com - An Open Cocktail Database with API - enen92 - 2015-09-01 18:08
The site looks beautiful but I can't see how this would fit at all into kodi. Do you have any examples of the meedio script you mention?
I might think about it later but the only option I see here at all is for a screensaver. Probably an excuse to look into how they work
PS: Probably a good idea to add a random method to the db. And (best) a random method that returns only complete drinks.
RE: TheCocktailDB.com - An Open Cocktail Database with API - zag - 2015-09-01 23:35
Basically it was just a cocktail browser idea, with a search ect. Next/Previous/Random cocktail browse. Similar to a movie showcase view.
I could make some API methods to browse the cocktails by ingredients with filters or something.
There is a nice android app that I use on my phone but it would be nice to have it inside Kodi one day.
EDIT: API random (must contain cocktail image)
RE: TheCocktailDB.com - An Open Cocktail Database with API - enen92 - 2015-09-02 16:24
Ok, it seems it is your lucky day (...or not since you just got Ola John in Reading FC )
It is both a program addon and an interactive screensaver for Kodi (Feedreader was used as a base so thanks to the developer). At the moment the program addon just executes the same code as the screensaver but it is pretty simple to develop a browsing interface using the default kodi views to browse categories and drinks. The "cocktail recipe window" is prepared to receive also a simple cocktail and act as a "player" once (and if) you get there on the api side.
Normally screensavers will be closed as soon as you hit any input. This one is a bit different and locks specific keys:
* Context menu key (or C on a regular keyboard) will let you search cocktails
* Left or right will change the presented cocktail to a new random (*and different*) one (if quioske mode is not enabled in the addon settings).
* In case the drink has more than 6 ingredients (example Ramos Fizz #2) left and right will manually change the ingredients from 1-6 7-13 13-15. The addon switches them also without user input at 10% (fast mode) or 20% (slow mode) of the time defined to randomly present new cocktails
Screenshot of the init screen (instructions can be disabled but by default are presented on init for 2 seconds - before getting the first random drink):
In case you want a browsing interface (I think the default kodi thumbnail view will work perfectly fine for this) just add the required methods to the api. We need a way of getting all the categories in the db (by glass, by type - alchoolic etc, by genre (ordinary etc), a way to get drinks passed the filter key, and a way to retrieve drinks given the drink_id for that to be a reality.
Download here: https://github.com/enen92/script.screensaver.cocktail
I was not expecting it but this one ended up being probably the funniest addon I've made.
Congratulations, you now officially owe me a few drinks
RE: TheCocktailDB.com - An Open Cocktail Database with API - zag - 2015-09-02 17:50
Superb! I knew I could tempt you
Seriously, many thanks for this, its something I've always wanted in the living room TV, and can imagine the possibilites to use Kodi in a bar now!
I cant test for a few days due to a house move, but here are a few new API methods, most are currently limited to 250 records.
RE: TheCocktailDB.com - An Open Cocktail Database with API - enen92 - 2015-09-02 18:33
Let's see where I can get with it
edit: Added a few thumbnails to the site as well so we can have some more random drinks. We should now have ~ 50.
RE: TheCocktailDB.com - An Open Cocktail Database with API - enen92 - 2015-09-03 13:19
@zag it looks you forgot the most important method:
Given the id, return the recipe
RE: TheCocktailDB.com - An Open Cocktail Database with API - zag - 2015-09-03 14:56
(2015-09-03 13:19)enen92 Wrote: @zag it looks you forgot the most important method:
RE: TheCocktailDB.com - An Open Cocktail Database with API - enen92 - 2015-09-03 15:03
Also (not that it matters much) you have a typo on the post above on the search by glass. The variable should be $g.
The addon is almost done. I am trying to add YouTube queries now. Later today (if I manage to finish it) I'll push to GitHub.
RE: TheCocktailDB.com - An Open Cocktail Database with API - enen92 - 2015-09-04 03:45
As usual, nothing is that simple. It looks like an addon can't be a plugin and a screensaver at the same time (only a script + screensaver). So, I had to create the whole interface. Luckily, I borrowed a few textures from the amazing extended info script.
Just finished the plugin, it's ready for submission so please test it (when you can), see if you need anything implemented or modified and let me know.
I won't talk much about the functionalities of the script, the screenshots are self-explanatory (first 2 are the screensaver). Gotta love clearart
Source code: https://github.com/enen92/script.screensaver.cocktail
GPL 2 as usual.
Hope you like it
RE: TheCocktailDB.com - An Open Cocktail Database with API - zag - 2015-09-04 10:23
Can't thank you enough for this, its pretty much exactly how I envisioned it.
Tested it properly today, and works nicely, very fast too. Are you using the small preview images for the smaller thumbnails?
Only a few minor comments that I can think of:
- Screensaver initial message moves away a bit too fast, maybe needs another second delay.
- Clicking on the ingredients in the lookup view could go back to the cocktail browser (or maybe a description of the ingredient if I put that in the DB)
Overall fantastic work, and also great GUI design, I love the soft edge selection textures.
Get it submitted to the Official Kodi Repo and I will try to get it mentioned in the next blog add-on showcase news item.
EDIT: Oh and could you make a new thread for the add-on? So we can keep this thread seperate for the site.
RE: TheCocktailDB.com - An Open Cocktail Database with API - Razze - 2015-09-04 12:58
This might also be nice if the api gets integrated with duckduckgo search results.
Something along the lines is done here https://github.com/duckduckgo/zeroclickinfo-goodies/pull/1208
RE: TheCocktailDB.com - An Open Cocktail Database with API - enen92 - 2015-09-04 14:15
I am using the default images (700x700 & 1000x1000) you have on the db, the interface despite looking different is pretty small hence the speed. Also Kodi caches the images and you don't have to grab them again if loaded once.
The initial instructions delay can be configured on the addon settings but I'll add another second to the default value.
As for the second request, it might be a bit tricky. Is doable but it will require a bit of time to implement since the xmlwindow is the same for screensaver & lookup (hence a few keys locked). I'll leave that for a further update after submission (when u implement description of ingredients on the db).
Don't know if you plan to add API keys to the site but it would be cool to use a proper key instead of '1'.
Also, I will add a way to mark drinks as favourites + a new item on the menu. Think it will be quick to implement.
If you don't like any of the builtin images for the menus just send me new ones (same size) and I will replace them.
Glad you like it
Ps: rounded textures stolen from script.extendedinfo so credits to phil (mentioned on README on GitHub)