Skip to content

Commit c7f50e1

Browse files
committed
Revert "april fools time!"
This reverts commit 73302fe, reversing changes made to 7f2c4e7.
1 parent 73302fe commit c7f50e1

9 files changed

Lines changed: 15 additions & 328 deletions

File tree

bluesky/blueskyapi.go

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -653,14 +653,9 @@ func AuthorTTB(author User) *bridge.TwitterUser {
653653
ProfileBannerURL: banner_url,
654654
ProfileBannerURLHttps: banner_url,
655655

656-
Location: "",
657-
ProfileLinkColor: "0000ff",
658-
IsTranslator: func() bool {
659-
if author.Handle == "preloading.dev" || author.Handle == "preloading.bsky.social" {
660-
return true
661-
}
662-
return false
663-
}(),
656+
Location: "",
657+
ProfileLinkColor: "0000ff",
658+
IsTranslator: false,
664659
ContributorsEnabled: false,
665660
URL: "",
666661
UtcOffset: nil,
@@ -670,23 +665,9 @@ func AuthorTTB(author User) *bridge.TwitterUser {
670665
ProfileTextColor: "000000",
671666
Protected: false,
672667

673-
Lang: "en",
674-
Notifications: nil,
675-
Verified: func() bool {
676-
if author.Handle == "theonion.com" ||
677-
author.Handle == "bag-xml.com" ||
678-
author.Handle == "skyglow.es" ||
679-
author.Handle == "yzu.moe" ||
680-
author.Handle == "retrofoxxo.bsky.social" ||
681-
author.Handle == "invoxiplaysgames.uk" ||
682-
author.Handle == "handle.invalid" ||
683-
author.Handle == "kirb.me" ||
684-
author.Handle == "preloading.dev" ||
685-
author.Handle == "preloading.bsky.social" {
686-
return true
687-
}
688-
return false
689-
}(),
668+
Lang: "en",
669+
Notifications: nil,
670+
Verified: false,
690671
ProfileBackgroundColor: "c0deed",
691672
GeoEnabled: false,
692673
Description: author.Description,

bridge/bridge.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,7 @@ type Tweet struct {
7878
Retweeted bool `json:"retweeted" xml:"retweeted"`
7979
RetweetedStatus *RetweetedTweet `json:"retweeted_status,omitempty" xml:"retweeted_status,omitempty"`
8080
CurrentUserRetweet *CurrentUserRetweet `json:"current_user_retweet,omitempty" xml:"current_user_retweet,omitempty"`
81-
82-
// lulz
83-
PromotedContent *PromotedContent `json:"promoted_content,omitempty" xml:"promoted_content,omitempty"`
84-
}
85-
86-
// https://seriot.ch/projects/abusing_twitter_api.html#42 + decomp of android
87-
type PromotedContent struct {
88-
ImpressionId string `json:"impression_id" xml:"impression_id"`
89-
DisclosureType string `json:"disclosure_type" xml:"disclosure_type"` // Known possible are political and promotional
90-
PromotedTrendId int `json:"promoted_trend_id,omitempty" xml:"promoted_trend_id,omitempty"`
9181
}
92-
9382
type CurrentUserRetweet struct {
9483
ID int64 `json:"id"`
9584
IDStr string `json:"id_str"`

config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func LoadConfig() (*Config, error) {
5858
viper.SetEnvPrefix("TWITTER_BRIDGE")
5959

6060
// Set default values
61-
viper.SetDefault("VERSION", "1.0.4-onion-edition") // wait till i forget to update this
61+
viper.SetDefault("VERSION", "1.0.4-beta") // wait till i forget to update this
6262
viper.SetDefault("SERVER_PORT", "3000")
6363
viper.SetDefault("DEVELOPER_MODE", false)
6464
viper.SetDefault("DATABASE_TYPE", "sqlite")

static/index.html

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>THE ONION'S Twitter API Bridge</title>
6+
<title>Twitter API Bridge</title>
77
<style type="text/css">
88
body {
99
font-family: Arial, sans-serif;
@@ -67,14 +67,6 @@ <h2 class="text-center">Specifically Bluesky -> Twitter API V1</h2>
6767
<p class="subtext text-center">Running version {{.Version}}</p>
6868
<div class="bar"></div>
6969
<br>
70-
<div class="dev-warning">
71-
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAACGFjVEwAAAACAAAAAPONk3AAAAAMUExURf//AP+uAP///wAAAB/mRh0AAAABdFJOUwBA5thmAAAAGmZjVEwAAAAAAAAAGAAAABgAAAAAAAAAAABkAGQAALb1ADAAAABmSURBVCjPfdJBEsAgCANAjP//cyugKAZzzE5qx1YkAggNWkPRU9GeSQWjB4hUYD0RbXq/wAY/ZKnATxhwSgV2GQFL5rsqbJM58MQER79N1sAetSYxcPBJOiEm/h1yHsAF9tfcEfkAAuECObCQ8esAAAAaZmNUTAAAAAEAAAACAAAACwAAAAsAAAAIAGQAZAAABgD2jwAAABFmZEFUAAAAAijPY2BiYsCLAAL3AC2FC0/sAAAAGHRFWHRTb2Z0d2FyZQBnaWYyYXBuZy5zZi5uZXSW/xPIAAAAAElFTkSuQmCC">
72-
<b>We've just been bought by the finest news source, The Onion. We will be proceeding to be catering to the needs of the might onion, and rebranding our services.</b>
73-
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAACGFjVEwAAAACAAAAAPONk3AAAAAMUExURf//AP+uAP///wAAAB/mRh0AAAABdFJOUwBA5thmAAAAGmZjVEwAAAAAAAAAGAAAABgAAAAAAAAAAABkAGQAALb1ADAAAABmSURBVCjPfdJBEsAgCANAjP//cyugKAZzzE5qx1YkAggNWkPRU9GeSQWjB4hUYD0RbXq/wAY/ZKnATxhwSgV2GQFL5rsqbJM58MQER79N1sAetSYxcPBJOiEm/h1yHsAF9tfcEfkAAuECObCQ8esAAAAaZmNUTAAAAAEAAAACAAAACwAAAAsAAAAIAGQAZAAABgD2jwAAABFmZEFUAAAAAijPY2BiYsCLAAL3AC2FC0/sAAAAGHRFWHRTb2Z0d2FyZQBnaWYyYXBuZy5zZi5uZXSW/xPIAAAAAElFTkSuQmCC">
74-
</div>
75-
<br>
76-
<div class="bar"></div>
77-
<br>
7870
{{if .NotConfigured}}
7971
<div class="dev-warning">
8072
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAACGFjVEwAAAACAAAAAPONk3AAAAAMUExURf//AP+uAP///wAAAB/mRh0AAAABdFJOUwBA5thmAAAAGmZjVEwAAAAAAAAAGAAAABgAAAAAAAAAAABkAGQAALb1ADAAAABmSURBVCjPfdJBEsAgCANAjP//cyugKAZzzE5qx1YkAggNWkPRU9GeSQWjB4hUYD0RbXq/wAY/ZKnATxhwSgV2GQFL5rsqbJM58MQER79N1sAetSYxcPBJOiEm/h1yHsAF9tfcEfkAAuECObCQ8esAAAAaZmNUTAAAAAEAAAACAAAACwAAAAsAAAAIAGQAZAAABgD2jwAAABFmZEFUAAAAAijPY2BiYsCLAAL3AC2FC0/sAAAAGHRFWHRTb2Z0d2FyZQBnaWYyYXBuZy5zZi5uZXSW/xPIAAAAAElFTkSuQmCC">

twitterv1/cdnproxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,6 @@ func CDNVideoProxy(c *fiber.Ctx) error {
207207
// It's a basic html page that includes the hls.js library, a video element, and a script that checks if the browser supports hls, and if it doesn't, it uses hls.js to play the video
208208
// why u hef to be mad golang warning thingy?
209209
return c.SendString(fmt.Sprintf(`
210-
<meta content="width=device-width,initial-scale=1"name=viewport><title>Onion Video</title><style>*{margin:0;padding:0;width:100%%;height:100%%}</style><body><script src=https://cdn.jsdelivr.net/npm/hls.js@1></script><video autoplay="autoplay" controls id=v poster=%s src=%s></video><script>var v=document.getElementById("v");if(v.canPlayType("application/vnd.apple.mpegurl"));else if(Hls.isSupported()){var h=new Hls;h.loadSource(v.src),h.attachMedia(v)}</script>
210+
<meta content="width=device-width,initial-scale=1"name=viewport><title>Bluesky Video</title><style>*{margin:0;padding:0;width:100%%;height:100%%}</style><body><script src=https://cdn.jsdelivr.net/npm/hls.js@1></script><video autoplay="autoplay" controls id=v poster=%s src=%s></video><script>var v=document.getElementById("v");if(v.canPlayType("application/vnd.apple.mpegurl"));else if(Hls.isSupported()){var h=new Hls;h.loadSource(v.src),h.attachMedia(v)}</script>
211211
`, thumbnail_url, video_url))
212212
}

twitterv1/discover.go

Lines changed: 0 additions & 212 deletions
Original file line numberDiff line numberDiff line change
@@ -173,215 +173,3 @@ func trends_woeid(c *fiber.Ctx) error {
173173
},
174174
})
175175
}
176-
177-
func discovery(c *fiber.Ctx) error {
178-
179-
return c.SendString(`
180-
181-
182-
{
183-
"statuses": [
184-
{
185-
"coordinates": null,
186-
"favorited": false,
187-
"created_at": "Tue Apr 01 05:34:17 +0000 2025",
188-
"truncated": false,
189-
"entities": {
190-
"media": [],
191-
"urls": null,
192-
"user_mentions": [
193-
{
194-
"name": "theonion.com",
195-
"id": 5479733389352290846,
196-
"id_str": "5479733389352290846",
197-
"indices": [
198-
59,
199-
72
200-
],
201-
"screen_name": "theonion.com"
202-
}
203-
],
204-
"hashtags": null
205-
},
206-
"text": "In a legendary move, the world's finest news organization, @theonion.com has purchased \"A Twitter Bridge\". From now on, we will:\n\n- Be including ads into our platform, hosted by the onion\n- All news stories will be from the onion\n- and more!\n\nEnjoy this enhanced version of A Twitter Bridge.",
207-
"annotations": null,
208-
"contributors": null,
209-
"id": 6396966313848207287,
210-
"id_str": "6396966313848207287",
211-
"geo": null,
212-
"place": null,
213-
"user": {
214-
"name": "Preloading",
215-
"profile_sidebar_border_color": "87bc44",
216-
"profile_background_tile": false,
217-
"profile_sidebar_fill_color": "e0ff92",
218-
"created_at": "Sat Nov 16 02:29:14 +0000 2024",
219-
"profile_image_url": "` + configData.CdnURL + `/cdn/img/?url=https%3A%2F%2Fcdn.bsky.app%2Fimg%2Favatar%2Fplain%2Fdid%3Aplc%3Akhcyntihpu7snjszuojjgjc4%2Fbafkreifjrbt5v4h7ufdxuwuivlkagawbwsxaqattjmjlxcfrhiymjnozvy%40jpeg:profile_bigger",
220-
"profile_image_url_https": "` + configData.CdnURL + `/cdn/img/?url=https%3A%2F%2Fcdn.bsky.app%2Fimg%2Favatar%2Fplain%2Fdid%3Aplc%3Akhcyntihpu7snjszuojjgjc4%2Fbafkreifjrbt5v4h7ufdxuwuivlkagawbwsxaqattjmjlxcfrhiymjnozvy%40jpeg:profile_bigger",
221-
"location": "",
222-
"profile_link_color": "0000ff",
223-
"follow_request_sent": false,
224-
"url": "",
225-
"favourites_count": 0,
226-
"contributors_enabled": false,
227-
"utc_offset": null,
228-
"id": 5123166115319017703,
229-
"id_str": "5123166115319017703",
230-
"profile_use_background_image": false,
231-
"profile_text_color": "000000",
232-
"protected": false,
233-
"followers_count": 92,
234-
"lang": "en",
235-
"notifications": null,
236-
"time_zone": null,
237-
"verified": false,
238-
"profile_background_color": "c0deed",
239-
"geo_enabled": false,
240-
"description": "I make stuff that doesn't work.\n\nhe/him\nDiscord: @Preloading\nMastodon: @preloading@mastodon.social\nWebsite: loganserver.net",
241-
"friends_count": 48,
242-
"statuses_count": 160,
243-
"profile_banner_url": "",
244-
"profile_banner_url_https": "",
245-
"profile_background_image_url": "",
246-
"following": null,
247-
"screen_name": "preloading.dev",
248-
"show_all_inline_media": false,
249-
"is_translator": false,
250-
"listed_count": 0,
251-
"default_profile": false,
252-
"default_profile_image": false
253-
},
254-
"source": "Bluesky",
255-
"in_reply_to_user_id": null,
256-
"in_reply_to_user_id_str": null,
257-
"in_reply_to_status_id": null,
258-
"in_reply_to_status_id_str": null,
259-
"in_reply_to_screen_name": null,
260-
"possibly_sensitive": false,
261-
"retweet_count": 0,
262-
"retweeted": false
263-
}
264-
],
265-
"stories": [
266-
{
267-
"type": "news",
268-
"score": 0.92,
269-
"data": {
270-
"title": "The onion has now bought A Twitter Bridge!",
271-
"articles": [
272-
{
273-
"title": "The onion has now bought A Twitter Bridge!",
274-
"url": {
275-
"display_url": "twitterbridge.loganserver.net",
276-
"expanded_url": "https://twitterbridge.loganserver.net"
277-
},
278-
"tweet_count": 9999999999,
279-
"media": []
280-
}
281-
]
282-
},
283-
"social_proof": {
284-
"social_proof_type": "social",
285-
"referenced_by": {
286-
"global_count": 99999999999,
287-
"statuses": [
288-
{
289-
"coordinates": null,
290-
"favorited": false,
291-
"created_at": "Tue Apr 01 05:34:17 +0000 2025",
292-
"truncated": false,
293-
"entities": {
294-
"media": [],
295-
"urls": null,
296-
"user_mentions": [
297-
{
298-
"name": "theonion.com",
299-
"id": 5479733389352290846,
300-
"id_str": "5479733389352290846",
301-
"indices": [
302-
59,
303-
72
304-
],
305-
"screen_name": "theonion.com"
306-
}
307-
],
308-
"hashtags": null
309-
},
310-
"text": "In a legendary move, the world's finest news organization, @theonion.com has purchased \"A Twitter Bridge\". From now on, we will:\n\n- Be including ads into our platform, hosted by the onion\n- All news stories will be from the onion\n- and more!\n\nEnjoy this enhanced version of A Twitter Bridge.",
311-
"annotations": null,
312-
"contributors": null,
313-
"id": 6396966313848207287,
314-
"id_str": "6396966313848207287",
315-
"geo": null,
316-
"place": null,
317-
"user": {
318-
"name": "Preloading",
319-
"profile_sidebar_border_color": "87bc44",
320-
"profile_background_tile": false,
321-
"profile_sidebar_fill_color": "e0ff92",
322-
"created_at": "Sat Nov 16 02:29:14 +0000 2024",
323-
"profile_image_url": "` + configData.CdnURL + `/cdn/img/?url=https%3A%2F%2Fcdn.bsky.app%2Fimg%2Favatar%2Fplain%2Fdid%3Aplc%3Akhcyntihpu7snjszuojjgjc4%2Fbafkreifjrbt5v4h7ufdxuwuivlkagawbwsxaqattjmjlxcfrhiymjnozvy%40jpeg:profile_bigger",
324-
"profile_image_url_https": "` + configData.CdnURL + `/cdn/img/?url=https%3A%2F%2Fcdn.bsky.app%2Fimg%2Favatar%2Fplain%2Fdid%3Aplc%3Akhcyntihpu7snjszuojjgjc4%2Fbafkreifjrbt5v4h7ufdxuwuivlkagawbwsxaqattjmjlxcfrhiymjnozvy%40jpeg:profile_bigger",
325-
"location": "",
326-
"profile_link_color": "0000ff",
327-
"follow_request_sent": false,
328-
"url": "",
329-
"favourites_count": 0,
330-
"contributors_enabled": false,
331-
"utc_offset": null,
332-
"id": 5123166115319017703,
333-
"id_str": "5123166115319017703",
334-
"profile_use_background_image": false,
335-
"profile_text_color": "000000",
336-
"protected": false,
337-
"followers_count": 92,
338-
"lang": "en",
339-
"notifications": null,
340-
"time_zone": null,
341-
"verified": false,
342-
"profile_background_color": "c0deed",
343-
"geo_enabled": false,
344-
"description": "I make stuff that doesn't work.\n\nhe/him\nDiscord: @Preloading\nMastodon: @preloading@mastodon.social\nWebsite: loganserver.net",
345-
"friends_count": 48,
346-
"statuses_count": 160,
347-
"profile_banner_url": "",
348-
"profile_banner_url_https": "",
349-
"profile_background_image_url": "",
350-
"following": null,
351-
"screen_name": "preloading.dev",
352-
"show_all_inline_media": false,
353-
"is_translator": false,
354-
"listed_count": 0,
355-
"default_profile": false,
356-
"default_profile_image": false
357-
},
358-
"source": "Bluesky",
359-
"in_reply_to_user_id": null,
360-
"in_reply_to_user_id_str": null,
361-
"in_reply_to_status_id": null,
362-
"in_reply_to_status_id_str": null,
363-
"in_reply_to_screen_name": null,
364-
"possibly_sensitive": false,
365-
"retweet_count": 0,
366-
"retweeted": false
367-
}
368-
]
369-
}
370-
}
371-
}
372-
],
373-
"related_queries": [
374-
{
375-
"query": "The Onion"
376-
},
377-
{
378-
"query": "A Twitter Bridge"
379-
}
380-
],
381-
"spelling_corrections": []
382-
}
383-
384-
385-
`)
386-
387-
}

twitterv1/lists.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func list_timeline(c *fiber.Ctx) error {
155155
list = *listPtr
156156
}
157157

158-
return convert_timeline(c, list, blueskyapi.GetListTimeline, false)
158+
return convert_timeline(c, list, blueskyapi.GetListTimeline)
159159
}
160160

161161
func GetListMembers(c *fiber.Ctx) error {

0 commit comments

Comments
 (0)