mirror of
https://github.com/redlib-org/redlib.git
synced 2025-06-08 15:47:48 +00:00
Add pages to subreddits
This commit is contained in:
parent
0054557c86
commit
7a176c6804
8 changed files with 95 additions and 39 deletions
|
@ -5,7 +5,7 @@ use chrono::{TimeZone, Utc};
|
|||
|
||||
#[path = "utils.rs"]
|
||||
mod utils;
|
||||
use utils::{nested_val, val, Flair, Params, Post, User, request};
|
||||
use utils::{nested_val, request, val, Flair, Params, Post, User};
|
||||
|
||||
// STRUCTS
|
||||
#[derive(Template)]
|
||||
|
@ -37,7 +37,7 @@ async fn page(web::Path(username): web::Path<String>, params: web::Query<Params>
|
|||
async fn user(name: &String) -> User {
|
||||
// Build the Reddit JSON API url
|
||||
let url: String = format!("https://www.reddit.com/user/{}/about.json", name);
|
||||
|
||||
|
||||
// Send a request to the url, receive JSON in response
|
||||
let res = request(url).await;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue