Closed stephancom closed 9 years ago
Hi @stephancom,
The .api files are the source code to the APIs. You can code them at https://randomapi.com. Take a look at the documentation and if you need help, comment on this PR or you could send a message to beta@randomapi.com
Sorry for the lack of documentation, the readme for this repo and the documentation over at RandomAPI are going to receive a huge overhaul in the coming weeks.
My question still stands, in the example you point to:
title = {if,{field,gender},==,male,mr,{list,fu0h1w}}
When I hover over {list,fu0h1w}
the help text reads "choose a random item from the specified list."
Okey dokey. How does fu0h1w
specify the list of men's titles? Is it the hash of the contents of the list? Or what?
When you are logged into randomapi.com and you are at the homepage, you can click on the "add list" button to upload or input a list of values. A list is basically a text file with different values on each line.
When you upload the list, you'll be given a reference id. That's the {list,fu0h1w}
code that you were seeing.
This basically says to fetch a random item from the list that has the reference id "fu0h1w".
So for the example, the list "fu0h1w" looks like this:
ms
mrs
miss
So, title = {if,{field,gender},==,male,mr,{list,fu0h1w}}
reads out like this:
If the field name "gender" equals "male", assign the value "mr" to the field named "title" or else select a random item from the list "fu0h1w" and assign that value to the field named "title".
Hope that clears it up for you :)
ah, so it would seem I cannot directly create the API to go with the dataset on github, because I need to generate the references to the list by uploading the lists to your site, which generates the reference ID through some (presumably not open source) process.
The list reference id is basically a unique, random 7 character alphanumeric string. There isn't anything really secret or closed source about the process? It's like an order number that is generated when you buy something online. You can then provide that Id number and the API generator will instantly know which list you want to choose a random item from.
needs api files - documentation is not clear on what stuff like {~fu0h1w} means - is this a hash of a list? where is US/api/0.5/US_female.api getting titles from?