Skip to content

Commit 22cdb07

Browse files
authored
Merge pull request #716 from florean/711-remove-x
refactor(main): remove Twitter from frontend
2 parents 6f4481f + 5dcebe8 commit 22cdb07

File tree

11 files changed

+26
-60
lines changed

11 files changed

+26
-60
lines changed

ARCHITECTURE.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ BCB2 uses a [Postgres](https://www.postgresql.org/) database to keep track of ca
1212

1313
## Posting
1414

15-
BCB2 posts to Twitter ([@big_cases](https://twitter.com/big_cases)), Mastodon ([@[email protected]](https://law.builders/@bigcases)), and Bluesky ([@bigcases.bots.law](https://bsky.app/profile/bigcases.bots.law)).
15+
BCB2 posts to Mastodon ([@[email protected]](https://law.builders/@bigcases)) and Bluesky ([@bigcases.bots.law](https://bsky.app/profile/bigcases.bots.law)).
1616

1717

1818
## Interacting via social media
@@ -57,13 +57,12 @@ To set up a development machine, do the following:
5757

5858
### What does the server do?
5959

60-
- Receives webhooks from CourtListener, Twitter, and Mastodon
60+
- Receives webhooks from CourtListener and Mastodon
6161
- Processes new documents from CourtListener (generate thumbnails, create posts, post)
6262

6363
## Incoming webhooks
6464

6565
- `/webhooks/docket-[secret]`: From CourtListener, delivered when there is a new document in a followed case. The full URL is secret.
66-
- `/webhooks/twitter`: From Twitter, Account Activity API
6766
- `/webhooks/mastodon`: From Mastodon instance, Web Push API
6867

6968
## Images

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
Big Cases Bot 2 is a bot that sends messages about important federal cases as
44
they happen. Currently, Big Cases Bot 2 sends to the following channels:
55

6-
- Twitter: [@big_cases][twitterbc]
76
- Mastodon: [@[email protected]][mastodonbc]
87
- Bluesky: [@bigcases.bots.law][blueskybc]
98

@@ -61,6 +60,5 @@ It costs a lot to build and maintain this system and we need your support.
6160
[bcb1]: https://github.com/bdheath/Big-Cases
6261
[c]: https://free.law/contact/
6362
[litte]: https://github.com/freelawproject/bigcases2/issues/8
64-
[twitterbc]: https://twitter.com/big_cases
6563
[mastodonbc]: https://law.builders/@bigcases
6664
[blueskybc]: https://bsky.app/profile/bigcases.bots.law

bc/assets/templates/base.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
<meta http-equiv="Content-Language" content="en"/>
99
<meta name="language" content="en_us"/>
1010
<meta name="viewport" content="width=device-width,initial-scale=1"/>
11-
<meta name="description" content="Use Bots.law to get court alerts in Slack, Discord, MS Teams, Twitter, Mastodon, and Google Chat. Home of the Big Cases bots."/>
11+
<meta name="description" content="Use Bots.law to get court alerts in Slack, Discord, MS Teams, Mastodon, and Google Chat. Home of the Big Cases bots."/>
1212
<meta name="htmx-config" content='{"includeIndicatorStyles":false}'>
1313
<meta property="og:type" content="website"/>
1414
<meta property="og:title" content="Bots.law"/>
15-
<meta property="og:description" content="Use Bots.law to get court alerts in Slack, Discord, MS Teams, Twitter, Mastodon, and Google Chat. Home of the Big Cases bots.">
15+
<meta property="og:description" content="Use Bots.law to get court alerts in Slack, Discord, MS Teams, Mastodon, and Google Chat. Home of the Big Cases bots.">
1616
<meta property="og:url" content="{% block og_url %}{% get_full_host %}{{ request.path }}{% endblock %}"/>
1717
<meta property="og:site_name" content="Bots.law"/>
1818
<meta property="og:image" content="{% static "png/og-image-1280x640.png" %}"/>

bc/assets/templates/includes/footer.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,6 @@ <H5>About FLP</H5>
8888
</div>
8989
</a>
9090

91-
<a href="https://twitter.com/freelawproject" class="rounded-full bg-gray-500 p-3" aria-label="Twitter Link">
92-
<div class="h-5 w-5 text-white">
93-
{% include './inlines/twitter.svg' %}
94-
</div>
95-
</a>
96-
9791
<a href="https://donate.free.law/np/clients/freelawproject/subscribe.jsp?subscription=9" class="rounded-full bg-gray-500 p-3" aria-label="Newsletter Link">
9892
<div class="w-5 h-5 stroke-white">
9993
{% include './inlines/newspaper.svg' %}

bc/assets/templates/includes/header.html

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,6 @@
7171
</div>
7272
Follow on Mastodon
7373
</a>
74-
<a href="https://twitter.com/big_cases" aria-label="Twitter" class="w-full flex p-3 items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium border-gray-500">
75-
<div class="h-6 w-6 text-gray-400">
76-
{% include './inlines/twitter.svg' %}
77-
</div>
78-
Follow on Twitter
79-
</a>
8074
</div>
8175
</div>
8276

@@ -118,7 +112,7 @@
118112
</a>
119113
</div>
120114
<div class="px-5 py-1 bg-gray-50 flex md:py-2 md:px-8">
121-
<div class="w-1/3">
115+
<div class="w-1/2">
122116
<a href="https://bsky.app/profile/bigcases.bots.law" aria-label="Bluesky" class="flex p-3 items-center justify-center rounded-md hover:bg-gray-100">
123117
<div class="h-5 w-5 text-gray-400">
124118
{% include './inlines/bluesky.svg' %}
@@ -128,7 +122,7 @@
128122
</div>
129123
</a>
130124
</div>
131-
<div class="w-1/3">
125+
<div class="w-1/2">
132126
<a rel="me" href="https://law.builders/@bigcases" aria-label="Mastodon" class="flex p-3 items-center justify-center rounded-md hover:bg-gray-100">
133127
<div class="h-6 w-6 text-gray-400">
134128
{% include './inlines/mastodon.svg' %}
@@ -138,16 +132,6 @@
138132
</div>
139133
</a>
140134
</div>
141-
<div class="w-1/3">
142-
<a href="https://twitter.com/big_cases" aria-label="Twitter" class="flex p-3 items-center justify-center rounded-md hover:bg-gray-100">
143-
<div class="h-6 w-6 text-gray-400">
144-
{% include './inlines/twitter.svg' %}
145-
</div>
146-
<div class="ml-3">
147-
<p class="text-xs lg:text-sm xl:text-base text-center font-medium">Twitter</p>
148-
</div>
149-
</a>
150-
</div>
151135
</div>
152136
</div>
153137
</div>

bc/subscription/tests/test_tasks.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from bc.channel.models import Channel, Post
66
from bc.channel.tests.factories import ChannelFactory, GroupFactory
77
from bc.core.utils.status.templates import (
8+
BLUESKY_FOLLOW_A_NEW_CASE,
89
MASTODON_FOLLOW_A_NEW_CASE,
9-
TWITTER_FOLLOW_A_NEW_CASE,
1010
)
1111
from bc.core.utils.tests.base import faker
1212
from bc.sponsorship.tests.factories import SponsorshipFactory
@@ -314,7 +314,7 @@ class EnqueuePostsForNewCaseTest(TestCase):
314314

315315
@classmethod
316316
def setUpTestData(cls) -> None:
317-
cls.channel = ChannelFactory(twitter=True)
317+
cls.channel = ChannelFactory(bluesky=True)
318318
cls.subscription = SubscriptionFactory(channels=[cls.channel])
319319
cls.subscription_w_link = SubscriptionFactory(
320320
article=True, channels=[cls.channel]
@@ -424,7 +424,7 @@ def test_can_enqueue_new_case_status(
424424
mock_api.return_value = api_wrapper
425425
mock_lookup.return_value = None
426426
mock_docket_by_cl_id.return_value = None
427-
message, _ = TWITTER_FOLLOW_A_NEW_CASE.format(
427+
message, _ = BLUESKY_FOLLOW_A_NEW_CASE.format(
428428
docket=self.subscription.name_with_summary,
429429
docket_link=self.subscription.cl_url,
430430
docket_id=self.subscription.cl_docket_id,
@@ -448,7 +448,7 @@ def test_can_post_new_case_w_link(
448448
mock_api.return_value = api_wrapper
449449
mock_lookup.return_value = None
450450
mock_docket_by_cl_id.return_value = None
451-
message, _ = TWITTER_FOLLOW_A_NEW_CASE.format(
451+
message, _ = BLUESKY_FOLLOW_A_NEW_CASE.format(
452452
docket=self.subscription_w_link.name_with_summary,
453453
docket_link=self.subscription_w_link.cl_url,
454454
docket_id=self.subscription_w_link.cl_docket_id,
@@ -484,7 +484,7 @@ def test_can_post_new_case_w_thumbnails(
484484
thumb_2 = faker.binary(6)
485485
mock_thumbnails.return_value = [thumb_1, thumb_2]
486486
mock_download_pdf.return_value = document
487-
message, _ = TWITTER_FOLLOW_A_NEW_CASE.format(
487+
message, _ = BLUESKY_FOLLOW_A_NEW_CASE.format(
488488
docket=self.subscription_w_link.name_with_summary,
489489
docket_link=self.subscription_w_link.cl_url,
490490
docket_id=self.subscription_w_link.cl_docket_id,
@@ -546,7 +546,7 @@ def test_can_create_post_w_sponsored_thumbnails(
546546
thumb_4 = faker.binary(7)
547547
mock_sponsored.return_value = [thumb_3, thumb_4]
548548

549-
twitter_message, _ = TWITTER_FOLLOW_A_NEW_CASE.format(
549+
bluesky_message, _ = BLUESKY_FOLLOW_A_NEW_CASE.format(
550550
docket=self.subscription_w_link.name_with_summary,
551551
docket_link=self.subscription_w_link.cl_url,
552552
docket_id=self.subscription_w_link.cl_docket_id,
@@ -565,14 +565,14 @@ def test_can_create_post_w_sponsored_thumbnails(
565565
expected_enqueue_calls = [
566566
call(
567567
api_wrapper.add_status,
568-
masto_message,
568+
bluesky_message,
569569
None,
570570
[thumb_1, thumb_2],
571571
retry=mock_retry(),
572572
),
573573
call(
574574
api_wrapper.add_status,
575-
twitter_message,
575+
masto_message,
576576
None,
577577
[thumb_3, thumb_4],
578578
retry=mock_retry(),
@@ -598,7 +598,7 @@ class EnqueuePostsForNewFilingTest(TestCase):
598598

599599
@classmethod
600600
def setUpTestData(cls) -> None:
601-
cls.channel = ChannelFactory(twitter=True)
601+
cls.channel = ChannelFactory(bluesky=True)
602602
cls.subscription = SubscriptionFactory(channels=[cls.channel])
603603
cls.webhook_event = FilingWebhookEventFactory(
604604
docket_id=65745614,

bc/web/forms.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55

66

77
class BotSuggestionForm(ModelForm):
8-
TWITTER = "twitter"
8+
BLUESKY = "bluesky"
99
MASTODON = "mastodon"
10+
TWITTER = "twitter"
1011
PLATFORMS = (
11-
(TWITTER, "Twitter"),
12+
(BLUESKY, "Bluesky"),
1213
(MASTODON, "Mastodon"),
14+
(TWITTER, "Twitter"),
1315
)
1416
BOOLEAN_CHOICES = ((True, "Yes"), (False, "No"))
1517
platform = forms.MultipleChoiceField(

bc/web/templates/big-cases/about.html

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
{% block post_content %}
77
<p class="lead">The Big Cases Bot was created by Brad Heath at USA Today. It is maintained by Free Law Project, a 501(c)(3) that uses software and political advocacy to make the legal sector more equitable and competitive.</p>
8-
<p>To stay up to date with the biggest federal cases in the country, follow the Big Cases Bot on Bluesky, Mastodon or Twitter.</p>
8+
<p>To stay up to date with the biggest federal cases in the country, follow the Big Cases Bot on Bluesky and Mastodon.</p>
99

1010
<div class="flex items-center justify-center">
11-
<div class="w-1/3">
11+
<div class="w-1/2">
1212
<a href="https://bsky.app/profile/bigcases.bots.law"
1313
class="tracking-[.8px] flex items-center justify-center text-center whitespace-nowrap border border-transparent rounded-md shadow-sm text-base font-medium no-underline px-0.5 sm:text-md cursor bg-saffron-400 hover:bg-saffron-500">
1414
<div class="h-6 w-6">
@@ -19,7 +19,7 @@
1919
</div>
2020
</a>
2121
</div>
22-
<div class="w-1/3 ml-3">
22+
<div class="w-1/2 ml-3">
2323
<a href="https://law.builders/@bigcases"
2424
class="tracking-[.8px] flex items-center justify-center text-center whitespace-nowrap border border-transparent rounded-md shadow-sm text-base font-medium no-underline px-0.5 sm:text-md cursor bg-saffron-400 hover:bg-saffron-500">
2525
<div class="h-6 w-6">
@@ -30,17 +30,6 @@
3030
</div>
3131
</a>
3232
</div>
33-
<div class="w-1/3 ml-3">
34-
<a href="https://twitter.com/big_cases"
35-
class="tracking-[.8px] flex items-center justify-center text-center whitespace-nowrap border border-transparent rounded-md shadow-sm text-base font-medium no-underline px-0.5 sm:text-md cursor bg-saffron-400 hover:bg-saffron-500">
36-
<div class="h-6 w-6">
37-
{% include 'includes/inlines/twitter.svg' %}
38-
</div>
39-
<div class="ml-3">
40-
<p class="text-sm xl:text-base text-center font-medium"><span class="hidden md:inline">Follow on </span>Twitter</p>
41-
</div>
42-
</a>
43-
</div>
4433
</div>
4534

4635
<h2>I'm Following These Cases</h2>

bc/web/templates/big-cases/my-code.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</p>
3232
</li>
3333
<li>
34-
<p><a href="https://github.com/freelawproject/bigcases2/"><strong>Bots.law</strong></a> — The code in Bots.law ties everything together. It receives the webhook event, requests thumbnails, and posts updates to Twitter and Mastodon.
34+
<p><a href="https://github.com/freelawproject/bigcases2/"><strong>Bots.law</strong></a> — The code in Bots.law ties everything together. It receives the webhook event, requests thumbnails, and posts updates to Bluesky and Mastodon.
3535
</p>
3636
</li>
3737
</ol>

bc/web/templates/big-cases/sponsors.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<p>When you sponsor the Bot, you get the following benefits:</p>
1212
<ul>
1313
<li><p>Your name will be added as a sponsor to the Bot's profile on all social media platforms where the bot is available.</p></li>
14-
<li><p>We will thank you for your sponsorship with a post <a href="https://bsky.app/profile/bigcases.bots.law/post/3knyysg5au32i">like this one</a> on all platforms. This post will be pinned on Twitter.</p></li>
14+
<li><p>We will thank you for your sponsorship with a post <a href="https://bsky.app/profile/bigcases.bots.law/post/3knyysg5au32i">like this one</a> on all platforms. This post can be pinned on BlueSky if desired.</p></li>
1515
<li><p>Document thumbnails shared by the bot during your sponsorship will be watermarked <a href="https://bsky.app/profile/bigcases.bots.law/post/3knzmp65zoz2j">like this one</a> to show they were contributed by you.</p></li>
1616
<li><p>The posts from the bot receive around two million impressions per month, many of which will have your watermark.</p></li>
1717
</ul>
@@ -25,7 +25,7 @@
2525
{% include 'includes/action-button.html' with link="https://free.law/contact/" text='Contact Us' size="sm" color='saffron' %}
2626
</div>
2727
<div class="max-w-fit">
28-
{% include 'includes/action-button.html' with link="https://twitter.com/techcases_bot/status/1693714102382886951" text='See an Example' size="sm" color='saffron' %}
28+
{% include 'includes/action-button.html' with link="https://bsky.app/profile/trumplitigation.bots.law/post/3lshv23332e2s" text='See an Example' size="sm" color='saffron' %}
2929
</div>
3030
</div>
3131

0 commit comments

Comments
 (0)