-
Notifications
You must be signed in to change notification settings - Fork 8
Added Tutorial for beginner(phase 1, only get request demonstration) #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Test URL(https://www.w3schools.com/python/demopage.php) which we have used for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! The tutorial LGTM. I used it as an example for one of my cases (that requires to provide some data
).
module utils | ||
implicit none | ||
|
||
! Declare the function as public to make it accessible to other modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
! Declare the function as public to make it accessible to other modules | |
private | |
! Declare the function as public to make it accessible to other modules |
|
||
### Step 4: Create `utils.f90` | ||
|
||
In order to encapsulate helper functions for the program, we'll create a new file named `utils.f90` in the `src` folder. This module will contain the `int_to_str` function, which takes an integer as input and returns a string equivalent of that integer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is kind of distracting the reader (at least me, who tries to follow this tutorial to apply it on one of my cases). Why did you choose to implement your own function, instead of using to_string()
provided by stdlib
?
!! flag for weather the current repo found or not | ||
|
||
! Initialize the `api_url` variable with the GitHub API URL for fetching repositories | ||
api_url = 'https://github.com/api/orgs/fortran-lang/repos' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be define as a parameter
api_url = 'https://github.com/api/orgs/fortran-lang/repos' | ||
|
||
! Make an HTTP GET request to the API URL and store the response in the `response` variable | ||
response = request(url=api_url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the tutorial, it might be good to show how to check that the response was ok
.
```toml | ||
[dependencies] | ||
http.git = "https://github.com/fortran-lang/http-client.git" | ||
stdlib = "*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This requires at least fpm v0.9.0
. It might be good to mention it earlier.
Thanks @jvdp1 for the suggestions, I will add them |
Hello @jvdp1, I've included a comprehensive tutorial on the |
No description provided.