mirror of
				https://codeberg.org/ashley/poke
				synced 2025-07-17 16:52:11 +00:00 
			
		
		
		
	channels lets go
This commit is contained in:
		
							parent
							
								
									a9cc30b997
								
							
						
					
					
						commit
						ea42e6bc24
					
				
							
								
								
									
										14
									
								
								server.js
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								server.js
									
									
									
									
									
								
							| @ -78,10 +78,21 @@ app.get("/", function (req, res) { | ||||
|   renderTemplate(res, req, "main.ejs", { | ||||
|   random:things, | ||||
| });}); | ||||
| app.get("/channel", function (req, res) { | ||||
| app.get("/channel", async (req, res) => { | ||||
|     const ID = req.query.id; | ||||
|     const { toJson } = require("xml2json"); | ||||
|     | ||||
|     const bout = await fetch( | ||||
|     `https://lighttube.herokuapp.com/api/channel?id=${ID}&tab=about` | ||||
|   ); | ||||
|   const h = await bout.text(); | ||||
|   const k = JSON.parse(toJson(h)); | ||||
|   const { Subscribers: subscribers } = k.Channel.Metadata; | ||||
|   renderTemplate(res, req, "channel.ejs", { | ||||
|   ID:ID, | ||||
|   j:k, | ||||
|   about:k.Channel.Contents.ItemSection.About, | ||||
|   subs:typeof subscribers === 'string' ? subscribers.replace('subscribers', '') : 'Private' | ||||
| });}); | ||||
| app.get("/privacy", function (req, res) { | ||||
|   renderTemplate(res, req, "priv.ejs"); | ||||
| @ -106,6 +117,7 @@ app.get("/search", async (req, res) => { | ||||
|   const search = await fetch( | ||||
|     `https://lighttube.herokuapp.com/api/search?query=${query}` | ||||
|   ); | ||||
|    | ||||
|   const text = await search.text(); | ||||
|   const j = JSON.parse(toJson(text)); | ||||
|   if (!query) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Ashley
						Ashley