Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump decode-uri-component from 0.2.0 to 0.2.2 #128

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
8ca5e83
enable cloudflare web analysis feature
madawei2699 Jul 22, 2022
69f230e
Revert "enable cloudflare web analysis feature"
madawei2699 Jul 22, 2022
72c5fb9
update categories
madawei2699 Jul 23, 2022
bdfd4fc
add /dev/software-engineering-at-google/culture/
madawei2699 Jul 23, 2022
bf4e4bf
u /dev/software-engineering-at-google/culture/
madawei2699 Jul 23, 2022
2f7af55
u /dev/software-engineering-at-google/culture/
madawei2699 Jul 27, 2022
884d604
using giscus for blog comment feature
madawei2699 Jul 27, 2022
f41e1e7
remove sharethis && add share twitter
madawei2699 Jul 28, 2022
db70f0c
u /self/my-writing-story/250k
madawei2699 Jul 31, 2022
d313842
add /dev/software-engineering-at-google/process
madawei2699 Aug 11, 2022
bb65635
u /dev/software-engineering-at-google/process
madawei2699 Aug 11, 2022
fb4a7d4
u /link/
madawei2699 Aug 12, 2022
c7b87bb
u /talk/
madawei2699 Aug 13, 2022
3693b03
u /talk/
madawei2699 Aug 13, 2022
f3ffde1
u /affiliate/
madawei2699 Aug 22, 2022
f29c17c
u /tool/
madawei2699 Aug 23, 2022
8975f03
u /self/build-personal-knowledge-system
madawei2699 Aug 23, 2022
baddebb
u /dev/authentication-and-authorization-in-a-distributed-system/
madawei2699 Aug 24, 2022
de402b1
u /tool/
madawei2699 Aug 25, 2022
a35604c
fix bookmark error on mobile && enable it on PC
madawei2699 Aug 25, 2022
688d23b
fix bookmark on mobile scroll to begin error
madawei2699 Aug 25, 2022
b49ff20
fix can not bookmark when contains image
madawei2699 Aug 26, 2022
f75e76a
add bookmark toast message hint
madawei2699 Aug 26, 2022
efdbc36
fix mobile bookmark contains image error
madawei2699 Aug 26, 2022
70012b0
add bookmark utm_source for traffic analysis
madawei2699 Aug 26, 2022
f47801e
u /tool/
madawei2699 Aug 26, 2022
39f4046
u /tool/
madawei2699 Aug 26, 2022
51fa32b
update page-views api
madawei2699 Sep 2, 2022
5677981
add stats on list page
madawei2699 Sep 2, 2022
7df9c24
update list page style
madawei2699 Sep 2, 2022
3288dcc
update list page
madawei2699 Sep 2, 2022
93a7100
update /project/
madawei2699 Sep 11, 2022
73d757b
update footer
madawei2699 Sep 11, 2022
fbe8752
update links
madawei2699 Sep 11, 2022
979cb66
u /project/
madawei2699 Sep 11, 2022
e5c6a9c
u /project/
madawei2699 Sep 11, 2022
33d2a73
add //money/invest-alchemy/
madawei2699 Sep 12, 2022
f0e043f
u /tool/
madawei2699 Sep 15, 2022
ee7cd16
use og.bmpi.dev to generate open graph image dynamicly
madawei2699 Sep 15, 2022
2d1efd5
u /about/
madawei2699 Sep 15, 2022
984b506
Bump decode-uri-component from 0.2.0 to 0.2.2
dependabot[bot] Dec 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ out/

.clj-kondo/
.lsp/
.hugo_build.lock
52 changes: 44 additions & 8 deletions api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,51 @@ const viewsEndpoint = new awsx.apigateway.API("bmpi-dev-post-views", {

const client = new aws.sdk.DynamoDB.DocumentClient();

const result = await client.update({
TableName: counterTable.name.get(),
Key: { id: route },
UpdateExpression: "SET hit = if_not_exists(hit, :zero) + :incr",
ExpressionAttributeValues: { ":zero": 0, ":incr": incr },
ReturnValues:"UPDATED_NEW",
}).promise();
var count = 0;

let count = result.Attributes!.hit;
if (route == 'bmpi-dev-dev-page-views') {
const result = await client.scan({
TableName: counterTable.name.get(),
FilterExpression: "begins_with(id, :q) AND hit > :hit_filter",
ExpressionAttributeValues: {":q": "bmpi.dev/dev/", ":hit_filter": 100},
ProjectionExpression: "hit"
}).promise();
let items = result.Items!;
for (let item of items) {
count = count + item.hit;
}
} else if (route == 'bmpi-dev-self-page-views') {
const result = await client.scan({
TableName: counterTable.name.get(),
FilterExpression: "begins_with(id, :q) AND hit > :hit_filter",
ExpressionAttributeValues: {":q": "bmpi.dev/self/", ":hit_filter": 100},
ProjectionExpression: "hit"
}).promise();
let items = result.Items!;
for (let item of items) {
count = count + item.hit;
}
} else if (route == 'bmpi-dev-money-page-views') {
const result = await client.scan({
TableName: counterTable.name.get(),
FilterExpression: "begins_with(id, :q) AND hit > :hit_filter",
ExpressionAttributeValues: {":q": "bmpi.dev/money/", ":hit_filter": 100},
ProjectionExpression: "hit"
}).promise();
let items = result.Items!;
for (let item of items) {
count = count + item.hit;
}
} else {
const result = await client.update({
TableName: counterTable.name.get(),
Key: { id: route },
UpdateExpression: "SET hit = if_not_exists(hit, :zero) + :incr",
ExpressionAttributeValues: { ":zero": 0, ":incr": incr },
ReturnValues:"UPDATED_NEW",
}).promise();
count = result.Attributes!.hit;
}

return {
statusCode: 200,
Expand Down
Loading