Compare commits
	
		
			No commits in common. "878efc08d057b8fc5ff012f7aaa45021d862ff9f" and "04e29ed525400b4681a3e0f6a9c772db46a64378" have entirely different histories.
		
	
	
		
			878efc08d0
			...
			04e29ed525
		
	
		
					 1 changed files with 3 additions and 5 deletions
				
			
		
							
								
								
									
										8
									
								
								main.go
									
										
									
									
									
								
							
							
						
						
									
										8
									
								
								main.go
									
										
									
									
									
								
							|  | @ -29,8 +29,7 @@ import ( | ||||||
| const ( | const ( | ||||||
| 	serverAddr = "wss://jetstream2.us-west.bsky.network/subscribe" | 	serverAddr = "wss://jetstream2.us-west.bsky.network/subscribe" | ||||||
| 	// serverAddr = "wss://stream.zio.blue/subscribe" | 	// serverAddr = "wss://stream.zio.blue/subscribe" | ||||||
| 	postFormat      = "%s\n—\n<a href=\"https://bsky.app/profile/%s/post/%s\">🦋 @%s</a>" | 	postFormat = "%s\n—\n<a href=\"https://bsky.app/profile/%s/post/%s\">🦋 @%s</a>" | ||||||
| 	quotePostFormat = "<blockquote>%s</blockquote>\n<a href=\"https://bsky.app/profile/%s/post/%s\">➡️ @%s</a>\n—\n<a href=\"https://bsky.app/profile/%s/post/%s\">🦋 @%s</a>" |  | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| type handler struct { | type handler struct { | ||||||
|  | @ -179,7 +178,7 @@ func (h *handler) ProcessPost(event *models.Event) error { | ||||||
| 		if ps.Embed.Record.Type == "app.bsky.embed.record" { | 		if ps.Embed.Record.Type == "app.bsky.embed.record" { | ||||||
| 			handle, _ := h.bsky.GetHandleFromDID(strings.Split(ps.Embed.Record.Record.URI, "/")[2]) | 			handle, _ := h.bsky.GetHandleFromDID(strings.Split(ps.Embed.Record.Record.URI, "/")[2]) | ||||||
| 			captionText = fmt.Sprintf( | 			captionText = fmt.Sprintf( | ||||||
| 				quotePostFormat, | 				"<blockquote>%s</blockquote>\n<a href=\"https://bsky.app/profile/%s/post/%s\">➡️ @%s</a>\n—\n<a href=\"https://bsky.app/profile/%s/post/%s\">🦋 @%s</a>", | ||||||
| 				ps.ProcessFacets(), | 				ps.ProcessFacets(), | ||||||
| 				strings.Split(ps.Embed.Record.Record.URI, "/")[2], | 				strings.Split(ps.Embed.Record.Record.URI, "/")[2], | ||||||
| 				strings.Split(ps.Embed.Record.Record.URI, "/")[4], | 				strings.Split(ps.Embed.Record.Record.URI, "/")[4], | ||||||
|  | @ -190,7 +189,7 @@ func (h *handler) ProcessPost(event *models.Event) error { | ||||||
| 		} else { | 		} else { | ||||||
| 			handle, _ := h.bsky.GetHandleFromDID(strings.Split(ps.Embed.Record.URI, "/")[2]) | 			handle, _ := h.bsky.GetHandleFromDID(strings.Split(ps.Embed.Record.URI, "/")[2]) | ||||||
| 			captionText = fmt.Sprintf( | 			captionText = fmt.Sprintf( | ||||||
| 				quotePostFormat, | 				"<blockquote>%s</blockquote>\n<a href=\"https://bsky.app/profile/%s/post/%s\">➡️ @%s</a>\n—\n<a href=\"https://bsky.app/profile/%s/post/%s\">🦋 @%s</a>", | ||||||
| 				ps.ProcessFacets(), | 				ps.ProcessFacets(), | ||||||
| 				strings.Split(ps.Embed.Record.URI, "/")[2], | 				strings.Split(ps.Embed.Record.URI, "/")[2], | ||||||
| 				strings.Split(ps.Embed.Record.URI, "/")[4], | 				strings.Split(ps.Embed.Record.URI, "/")[4], | ||||||
|  | @ -232,7 +231,6 @@ func (h *handler) ProcessPost(event *models.Event) error { | ||||||
| 					resp, _ := http.Get(buildBlobURL(h.bsky.Bluesky.Cfg.PDSURL, h.bsky.Bluesky.Cfg.DID, media.URI)) | 					resp, _ := http.Get(buildBlobURL(h.bsky.Bluesky.Cfg.PDSURL, h.bsky.Bluesky.Cfg.DID, media.URI)) | ||||||
| 					defer resp.Body.Close() | 					defer resp.Body.Close() | ||||||
| 					f, _ := os.Create(media.URI + ".mp4") | 					f, _ := os.Create(media.URI + ".mp4") | ||||||
| 					defer f.Close() |  | ||||||
| 					io.Copy(f, resp.Body) | 					io.Copy(f, resp.Body) | ||||||
| 					f.Seek(0, 0) | 					f.Seek(0, 0) | ||||||
| 					mediaAdd := tgbotapi.NewInputMediaVideo(tgbotapi.FileReader{Name: "video.mp4", Reader: f}) | 					mediaAdd := tgbotapi.NewInputMediaVideo(tgbotapi.FileReader{Name: "video.mp4", Reader: f}) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue