Files
landing_page/automation/update-stats.sh
T
nastyapashandtrean 21776375a9 [WIP] New Pages (#873)
* Add Partnerspage

* fix

* fix padding

* tablet get-started-small update

* Add Customers page

* incorparated site-header partial

* fix

* Add community page (#886)

* Add community page

* site-header partial on the comunity page

---------

Co-authored-by: trean <trean.mi@gmail.com>

* Add Brand-Resources and Subscribe pages (#930)

* add Brand resources page

* add Subscribe page

* Add Qdrant for startups page (#934)

* Add Qdrant for startups page

* improve accordion and link to the form

* fix

* Add Stars page (#890)

* Add Stars page

* site-header partial on the stars page

* overlay z-index fix

---------

Co-authored-by: trean <trean.mi@gmail.com>

* new pages content update and accompanying css and html changes (#943)

* new pages content update and accompanying css and html changes

* format, removed comment, fix

* fixes

* subscribe page hubspot form (#946)

* brand resources content (#947)

* Stars page content (#945)

* stars page content update

* stars images format, replaced stars hero image

* uncommented stars menu link

* update stats: github stars and discord members number

* photo

* stars content upd

* stars list update

* Startup program content (#961)

* startup program hubspot form

* form fixes

* another form, some fixes

* content upd

* stars

* temp build options for the startups program page

---------

Co-authored-by: trean <trean.mi@gmail.com>
2024-06-17 15:56:32 +02:00

26 lines
1.1 KiB
Bash

#!/bin/bash
set -e
STAR_COUNT=$(curl -s https://api.github.com/repos/qdrant/qdrant | jq '.stargazers_count')
DISCORD_COUNT=$(curl -s https://discord.com/api/v9/invites/qdrant?with_counts=true&with_expiration=true)
DISCORD_COUNT=$(echo $DISCORD_COUNT | jq '.approximate_member_count')
if [ -z "$STAR_COUNT" ]; then
echo "Failed to get the star count"
exit 1
fi
# humanize the stats count like 18322 -> 18.3k
# and if star count is bigger than 1000, then add k at the end
STAR_COUNT=$(echo $STAR_COUNT | awk '{ if($1 > 1000) { printf "%.1fk\n", $1/1000 } else { print $1 } }' | tr ',' '.')
DISCORD_COUNT=$(echo $DISCORD_COUNT | awk '{ if($1 > 1000) { printf "%.1fk\n", $1/1000 } else { print $1 } }' | tr ',' '.')
# Update the star count in the markdown file
echo "Current star count: $STAR_COUNT"
echo "Updating the star count in the stats.md file"
sed -i "s/.*githubStars.*$/ githubStars: $STAR_COUNT/g" ./qdrant-landing/content/headless/stats.md
echo "Current discord count: $DISCORD_COUNT"
echo "Updating the discord count in the stats.md file"
sed -i "s/.*discordMembers.*$/ discordMembers: $DISCORD_COUNT/g" ./qdrant-landing/content/headless/stats.md