Skip to content

Commit

Permalink
/r/brutalism ~> r/brutalism
Browse files Browse the repository at this point in the history
  • Loading branch information
amancevice committed Apr 14, 2024
1 parent 0d4f152 commit a8fe77c
Show file tree
Hide file tree
Showing 19 changed files with 360 additions and 405 deletions.
2 changes: 1 addition & 1 deletion blue/bluesky/send-post/lib/lib/bluesky.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def thread(text:, link:, media:)
:uri => link,
}],
:index => {
:byteStart => text.bytes.length - '/r/brutalism'.bytes.length,
:byteStart => text.bytes.length - 'r/brutalism'.bytes.length,
:byteEnd => text.bytes.length,
}
}] unless text.nil?
Expand Down
2 changes: 1 addition & 1 deletion blue/reddit/pop-backlog/states.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ States:
TableName: ${table_name}
Item:
Id:
S.$: States.Format('/r/brutalism/{}', $.Name.S)
S.$: States.Format('r/brutalism/{}', $.Name.S)
Kind:
S: reddit/post
ExecutionId:
Expand Down
2 changes: 1 addition & 1 deletion blue/reddit/pop/lib/lib/reddit/post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def to_json

def to_item
{
Id: { S: "/r/brutalism/#{name}" },
Id: { S: "r/brutalism/#{name}" },
Kind: { S: 'reddit/post' },
Json: { S: to_json },
LastUpdate: { S: created_utc.iso8601 },
Expand Down
4 changes: 2 additions & 2 deletions blue/reddit/pop/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ resource "aws_iam_role" "lambda" {

resource "aws_lambda_function" "lambda" {
architectures = ["arm64"]
description = "Pop next post from /r/brutalism"
description = "Pop next post from r/brutalism"
filename = data.archive_file.lambda.output_path
function_name = local.name
handler = "index.pop"
Expand Down Expand Up @@ -148,7 +148,7 @@ resource "aws_cloudwatch_event_rule" "events" {
type = ["block_actions"]
actions = {
action_id = ["pop"]
value = ["/r/brutalism"]
value = ["r/brutalism"]
}
}
})
Expand Down
8 changes: 4 additions & 4 deletions blue/reddit/pop/states.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ States:
TableName: ${table_name}
Key:
Id:
S: /r/brutalism
S: r/brutalism
Kind:
S: cursor
ProjectionExpression: LastUpdate
Expand Down Expand Up @@ -44,7 +44,7 @@ States:
Value.$: $.QueueSize
Dimensions:
- Name: QueueName
Value: /r/brutalism
Value: r/brutalism
Retry:
- BackoffRate: 2
IntervalSeconds: 3
Expand All @@ -67,7 +67,7 @@ States:
TableName: ${table_name}
Key:
Id:
S: /r/brutalism
S: r/brutalism
Kind:
S: cursor
UpdateExpression: >-
Expand Down Expand Up @@ -104,7 +104,7 @@ States:
TableName: ${table_name}
Key:
Id:
S: /r/brutalism
S: r/brutalism
Kind:
S: cursor
UpdateExpression: >-
Expand Down
6 changes: 3 additions & 3 deletions blue/shared/local/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ file 'table.local.json' => 'table.json' do |f|
urls = -> (x) { x['image_url'] }
blocks = JSON.parse(item['JSON'])['blocks']
enum.yield(
Id: '/r/brutalism',
Id: 'r/brutalism',
Kind: 'cursor/posts',
LastUpdate: item['CREATED_UTC'],
Title: item['TITLE'],
MediaURLs: blocks.select(&images).map(&urls),
)
when 'STATS/MAX'
enum.yield(
Id: '/r/brutalism',
Id: 'r/brutalism',
Kind: 'cursor/queue',
LastUpdate: item['CREATED_UTC'],
Name: item['NAME'],
Expand All @@ -124,7 +124,7 @@ file 'table.local.json' => 'table.json' do |f|
post.dig('preview', 'images').map(&urls)
end
enum.yield(
Id: "/r/brutalism/#{item['GUID']}",
Id: "r/brutalism/#{item['GUID']}",
Kind: "reddit/post",
Status: item['STATE'],
LastUpdate: item['CREATED_UTC'],
Expand Down
2 changes: 1 addition & 1 deletion blue/shared/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ resource "aws_dynamodb_table_item" "cursor" {
range_key = aws_dynamodb_table.table.range_key

item = jsonencode({
Id = { S = "/r/brutalism" }
Id = { S = "r/brutalism" }
Kind = { S = "cursor" }
ExclusiveStartTime = { S = "1970-01-01:00:00:00Z" }
})
Expand Down
4 changes: 2 additions & 2 deletions blue/slack-beta/app-home/lib/lib/home.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ class Home
SCHEDULE_GROUP = ENV['SCHEDULE_GROUP'] || 'brutalismbot-blue'

QUEUES = {
'r/brutalism' => '/r/brutalism',
'r/brutalism' => 'r/brutalism',
}
RULES = {
'Bluesky' => "#{EVENT_BUS_NAME}-bluesky-send-post",
'Slack' => "#{EVENT_BUS_NAME}-slack-send-post",
'Twitter' => "#{EVENT_BUS_NAME}-twitter-send-post",
}
SCHEDULES = {
'Reddit' => "#{SCHEDULE_GROUP}-reddit-pop",
'Reddit' => "#{SCHEDULE_GROUP}-reddit-pop",
}

TEMPLATE = File.read(File.expand_path('home.yml.erb', File.dirname(__FILE__)))
Expand Down
2 changes: 1 addition & 1 deletion blue/slack-beta/app-home/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ resource "aws_iam_role" "lambda" {
Effect = "Allow"
Action = "dynamodb:GetItem"
Resource = data.aws_dynamodb_table.table.arn
# Condition = { "ForAllValues:StringEquals" = { "dynamodb:LeadingKeys" = ["backlog", "/r/brutalism"] } }
# Condition = { "ForAllValues:StringEquals" = { "dynamodb:LeadingKeys" = ["backlog", "r/brutalism"] } }
},
{
Sid = "GetSchedule"
Expand Down
4 changes: 2 additions & 2 deletions blue/slack-beta/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
display_information:
name: Brutalismbot Beta
description: Mirror posts from /r/brutalism
description: Mirror posts from r/brutalism
background_color: "#2a2254"
long_description: "Brutalismbot mirrors posts from the /r/brutalism subreddit to a #channel of your choosing using incoming webhooks. Post frequency depends on the volume of new submissions to /r/brutalism. Typical volume is ~6 posts per day."
long_description: "Brutalismbot mirrors posts from the r/brutalism subreddit to a #channel of your choosing using incoming webhooks. Post frequency depends on the volume of new submissions to r/brutalism. Typical volume is ~6 posts per day."
features:
app_home:
home_tab_enabled: true
Expand Down
2 changes: 1 addition & 1 deletion blue/slack-beta/screen/lib/lib/screener.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Image < Struct.new('Image', :url, :title, :alt) ; end
def self.images(text, media)
media.map(&:first).each_with_index.map do |m, i|
url = m['u']
title = media.one? ? '/r/brutalism' : "/r/brutalism [#{i + 1}/#{media.count}]"
title = media.one? ? 'r/brutalism' : "r/brutalism [#{i + 1}/#{media.count}]"
Image.new(url: url, alt: text, title: title)
end
end
Expand Down
2 changes: 1 addition & 1 deletion blue/slack/create-posts/lib/lib/post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Image < Struct.new('Image', :url, :title, :alt) ; end
def self.images(text, media)
media.map(&:first).each_with_index.map do |m, i|
url = m['u']
title = media.one? ? '/r/brutalism' : "/r/brutalism [#{i + 1}/#{media.count}]"
title = media.one? ? 'r/brutalism' : "r/brutalism [#{i + 1}/#{media.count}]"
Image.new(url: url, alt: text, title: title)
end
end
Expand Down
2 changes: 1 addition & 1 deletion blue/slack/create-posts/lib/lib/slack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def self.blocks(text, link, media)
images = media.map(&:first).each_with_index.map do |m, i|
url = m['u']
alt = text
title = media.one? ? '/r/brutalism' : "/r/brutalism [#{i + 1}/#{media.count}]"
title = media.one? ? 'r/brutalism' : "r/brutalism [#{i + 1}/#{media.count}]"
Block.image(image_url: url, alt_text: alt, title: title.plain_text)
end

Expand Down
5 changes: 2 additions & 3 deletions blue/slack/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
display_information:
name: Brutalismbot
description: Mirror posts from /r/brutalism
description: Mirror posts from r/brutalism
background_color: "#2a2254"
long_description: "Brutalismbot mirrors posts from the /r/brutalism subreddit to a #channel of your choosing using incoming webhooks. Post frequency depends on the volume of new submissions to /r/brutalism. Typical volume is ~6 posts per day."
long_description: "Brutalismbot mirrors posts from the r/brutalism subreddit to a #channel of your choosing using incoming webhooks. Post frequency depends on the volume of new submissions to r/brutalism. Typical volume is ~6 posts per day."
features:
app_home:
home_tab_enabled: false
Expand All @@ -27,4 +27,3 @@ settings:
org_deploy_enabled: false
socket_mode_enabled: false
token_rotation_enabled: false

117 changes: 55 additions & 62 deletions blue/website/www/error.html
Original file line number Diff line number Diff line change
@@ -1,68 +1,61 @@
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Web -->
<meta charset="utf-8" />
<meta name="author" content="small weird number" />
<meta name="description" content="Mirror posts from /r/brutalism" />
<meta name="title" content="Brutalismbot" />
<meta name="slack-app-id" content="AH0KW28C9" />
<title>404 | Brutalismbot</title>

<!-- Mobile -->
<meta name="viewport" content="width=device-width, initial-scale=1" />

<!-- Rich Previews -->
<meta property="og:description" content="Mirror posts from /r/brutalism" />
<meta property="og:image" content="/android-chrome-192x192.png" />
<meta property="og:site_name" content="Brutalismbot" />
<meta property="og:title" content="Error" />
<meta property="og:url" content="https://brutalismbot.com/" />

<!-- Favicon https://realfavicongenerator.net -->
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="manifest" href="/site.webmanifest" />
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#40374f" />
<meta name="msapplication-TileColor" content="#603cba" />
<meta name="theme-color" content="#40374f" />

<!-- Typeface -->
<link
href="https://fonts.googleapis.com/css?family=Asset|Quicksand:300|Righteous"
rel="stylesheet"
/>

<!-- Stylesheets -->
<link
rel="stylesheet"
type="text/css"
href="https://cdn.rawgit.com/dhg/Skeleton/2.0.4/css/normalize.css"
/>
<link
rel="stylesheet"
type="text/css"
href="https://cdn.rawgit.com/dhg/Skeleton/2.0.4/css/skeleton.css"
/>
<link rel="stylesheet" type="text/css" href="/main.css" />
</head>

<body>
<div class="title">
<h1>Brutalismbot</h1>
</div>

<div class="parallax"></div>

<div class="main">
<div class="container">
<div class="row">
<a><h2>Not Found</h2></a>

<div>That page does not exist.</div>
</div>
<head>
<!-- Web -->
<meta charset="utf-8" />
<meta name="author" content="small weird number" />
<meta name="description" content="Mirror posts from r/brutalism" />
<meta name="title" content="Brutalismbot" />
<meta name="slack-app-id" content="AH0KW28C9" />
<title>404 | Brutalismbot</title>

<!-- Mobile -->
<meta name="viewport" content="width=device-width, initial-scale=1" />

<!-- Rich Previews -->
<meta property="og:description" content="Mirror posts from r/brutalism" />
<meta property="og:image" content="/android-chrome-192x192.png" />
<meta property="og:site_name" content="Brutalismbot" />
<meta property="og:title" content="Error" />
<meta property="og:url" content="https://brutalismbot.com/" />

<!-- Favicon https://realfavicongenerator.net -->
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="manifest" href="/site.webmanifest" />
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#40374f" />
<meta name="msapplication-TileColor" content="#603cba" />
<meta name="theme-color" content="#40374f" />

<!-- Typeface -->
<link href="https://fonts.googleapis.com/css?family=Asset|Quicksand:300|Righteous" rel="stylesheet" />

<!-- Stylesheets -->
<link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/dhg/Skeleton/2.0.4/css/normalize.css" />
<link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/dhg/Skeleton/2.0.4/css/skeleton.css" />
<link rel="stylesheet" type="text/css" href="/main.css" />
</head>

<body>
<div class="title">
<h1>Brutalismbot</h1>
</div>

<div class="parallax"></div>

<div class="main">
<div class="container">
<div class="row">
<a>
<h2>Not Found</h2>
</a>

<div>That page does not exist.</div>
</div>
</div>
</body>
</div>
</body>

</html>
Loading

0 comments on commit a8fe77c

Please sign in to comment.