A new Flutter project.
If you want to maintain the code, there is a simple documentation made with dartdoc, its located in ./lib/doc/index.html
You can regen the documentation with dartdoc
command, if you dont have it use pub global activate dartdoc
at the root of the repository
To build project on github.io : flutter build web --web-renderer html cd build/web git add * git commit -m "" git push Go to "https://ydos2.github.io/Area"
Here is a list of the actual routes, how to use them and how to extract data from them, all these data will be a simple JSON.
All the calls have to be with the method GET and will return a 200 on success, otherwise see the on error
section
All data have a refresh time, as the server manage them with a timer to prevent you from sending too many requests to the APIs, they only refresh after a certain period of time.
/data/time
Gives you the time from this place, always funny to know.
refresh time
> 1 minute
params
place
=(City or country to check) => default: Toulouse
return value
{
city:
The city (or the capital of the targeted country)
region:
The region of the targeted place
country:
The targeted country
date:
The current date in the targeted city
time:
Current time in targeted city
}
on error
The response code is 404
in case no city was found
/weather
Gives you the weather from this place, so you can be jealous because its raining in you country >:).
refresh time
> 1 minute
params
place
=(City or country to check) => default: Toulouse
return value
{
weather:
The current weather in this country
icon:
A link to a cute image that shows the weather
temperature:
The actual temperature in this place in Celsius
feelslike:
The temperature you feel when you actually go out (in Celsius)
humidity:
The humidity of the air in per cent
}
on error
The response code is 404
in case no city was found
/data/joke
This route gives you a random "dad joke" from a wide variety
refresh time
> 5 minutes
return value
{
setup:
the setup of the joke
punchline:
The punchline of the joke AKA the funny
}
/user/register
Used to make a user register.
params
name
=How should the user be called
pass
=The user's password to register
mail
=The user's wich will recieve the confirmation mail
on error
401
> If the mail has already been used.
/user/login
Used to identify the user, if code 200 is recieved,
the user was identified successfully.
params
pass
=The user's password that he typed.
mail
=The user's mail he used for his registration.
on error
401
> If the mail or the password is incorrect or the mail was not recognized.
/area/time/discord
This route will send a discord message when a certain time is reached.
You can invite the bot on your discord server (by clicking here)[https://discord.com/oauth2/authorize?client_id=945702069376024656&permissions=0&scope=bot%20applications.commands]
it is mandatory to have the bot in a server you are in.
params
userID
=The user's discord ID tag (You can get it with discord OAuth2).
message
=A custom message you want to recieve (None for default).
time
=When should the user be pinged (exemple: time=11:25
)
/area/time/mail
This route will send a mail when a certain time is reached.
params
mail
=The mail that should revieve the message.
content
=The content of the mail (None for default).
object
=The mail's object (None for default).
time
=When should the user be pinged (exemple: time=11:25
)