pig feed system
This commit is contained in:
		
							parent
							
								
									c20f3d08d3
								
							
						
					
					
						commit
						8ee09ede65
					
				
							
								
								
									
										3
									
								
								rss/pig_fetch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								rss/pig_fetch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| #!/bin/sh | ||||
| 
 | ||||
| curl "$1" -o - | ||||
							
								
								
									
										14
									
								
								rss/pig_fetch.youtube
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								rss/pig_fetch.youtube
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,14 @@ | ||||
| #!/bin/sh | ||||
| 
 | ||||
| id(){ | ||||
| 	youtube-dl --skip-download --print-json --playlist-items 1 "$1" | jq '.channel_id' | tr -d '"' | ||||
| } | ||||
| 
 | ||||
| feedurl(){ | ||||
| 	printf "https://www.youtube.com/feeds/videos.xml?channel_id=%b" "$1" | ||||
| } | ||||
| 
 | ||||
| case "$1" in | ||||
| channel) feedurl "$(id "$2")" | ||||
| id) feedurl "$2" | ||||
| esac | xargs curl -o - -- | ||||
							
								
								
									
										19
									
								
								rss/pig_stow
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								rss/pig_stow
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,19 @@ | ||||
| #!/bin/sh | ||||
| set -x | ||||
| 
 | ||||
| while str isvalue "$1"; do | ||||
| 
 | ||||
| 	sh pig_fetch | xq -x "$( | ||||
| 		printf '. | ||||
| 	+ { | ||||
| 		pig: { | ||||
| 			feed_url: "%b", | ||||
| 			pet_sound: "oink", | ||||
| 			version: "0" | ||||
| 		} | ||||
| 	}' "$1" \ | ||||
| 		| tr -d '[:space:]' \ | ||||
| 	)" >"$(printf "%s\n" "$1" | tr -cd "[:alnum:]")".xml | ||||
| 
 | ||||
| 	shift | ||||
| done | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user