The title says it all. This was a project I did a while ago and just decided to share. This was originally a random food generator, but, I for some reason started thinking of random songs and phrases. Such as: “Nobody told me life was gonna be this way” and “What is love”. And now it is a random string generator. If this goes well, I might make a POST endpoint to submit strings .
Endpoints:
GET - http://cheesy-tech-api.glitch.me/api/v1/string
GET - http://cheesy-tech-api.glitch.me/api/v1/strings
GET - http://cheesy-tech-api.glitch.me/api/v1/string/:id:
POST - http://cheesy-tech-api.glitch.me/api/v1/string/add (https://reqbin.com/iwervjjz )
(for adding strings, you can use this tool to send a post request to the project)
(Source code coming to a Glitch project near you.)
I will be making a more advanced version of this. i.e. it is going to grab random words from the array and put them together.
3 Likes
Hmm, how random are these
The ID is what string it is. That is what the string/:id if for.
I personally recommend that you use something like the random word API:
https://random-word-api.herokuapp.com/home
1 Like
That is plan 2. In fact, I thought of that today.
1 Like
I am adding a POST endpoint soon.
1 Like
I made a sentence generator.
$pip install ntlk
$pip install faker
then on the python code do
import ntlk
import faker
while True:
print(colored(print(fake.sentence(ext_word_list=words.words())),random.choice(colors)))
That generates fake sentencees
Nice. I don’t use or like Python that much. So I try to use JS and or Lua as much as possible. (Maybe some HTML if needed.)
Where are you using words and where is ntlk used?
no_one
September 8, 2020, 6:42pm
14
I got “Never gonna give you up” and i thought it was fake XD
words are from the default ntlk array:
array_name = words.words()
but you only did import ntlk you didn’t define words or fake anywhere in the code
I am implementing a POST endpoint. Most likely will be api/v1/string/add.
I’ve been wating for this for a day or two
This took an hour to make lol
I shall be adding the lyrics to the app. (i need to)
This is super off-toooopic
2 Likes
Oh, I thought you made post requests and bypassed the check.
1 Like
If you want to make a post request, use api/v1/string/add and set the body.
1 Like
Are there any One Direction song lyrics by any chance?
Yeah this is what I call “Real Music”
I’ve been wating for this for a day or two
This took an hour to make lol
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[i…
I am totally not going to be adding these to the queue very shortly.
fake.sentence() generates a fake sentence i think that should work, the source code that works for me is at http://mayank1234cmd.glitch.me/python-modules/word-generator.py