mirror of
				https://github.com/TeamPiped/piped-rust-sdk.git
				synced 2024-08-14 23:56:06 +00:00 
			
		
		
		
	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:
		
							parent
							
								
									8a7a87824f
								
							
						
					
					
						commit
						d339785568
					
				
					 4 changed files with 71 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -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"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										15
									
								
								examples/search_channel.rs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								examples/search_channel.rs
									
										
									
									
									
										Normal 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);
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue