Feature search channel (#3)

* Simple search API

Initial support for searching for channels.
Additionally the parsing of the instance url got improved (e.g accept
URLs without protocol).

* Fixed crash with negative video amount

* Implement search suggestion
This commit is contained in:
Schmiddiii 2021-10-13 20:14:39 +02:00 committed by GitHub
parent 8a7a87824f
commit d339785568
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 71 additions and 2 deletions

View file

@ -29,6 +29,10 @@ path = "video.rs"
name = "search_suggestions"
path = "search_suggestions.rs"
[[example]]
name = "search_channel"
path = "search_channel.rs"
[[example]]
name = "comments"
path = "comments.rs"

View file

@ -0,0 +1,15 @@
use piped::PipedClient;
use reqwest::Client;
const INSTANCE: &'static str = "pipedapi.kavin.rocks";
#[tokio::main]
async fn main() {
let httpclient = Client::new();
let client = PipedClient::new(&httpclient, INSTANCE);
let suggestions = client.search_channel("techlore").await.unwrap();
println!("{:#?}", suggestions);
}