Skip to content

Commit

Permalink
Add SourceGraph tweet/project
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Jan 16, 2024
1 parent 468ba3c commit ad224c4
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 1 deletion.
48 changes: 48 additions & 0 deletions packages/docs/mock/tweets.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
{
"data": [
{
"entities": {
"urls": [
{
"start": 4,
"end": 27,
"url": "https://t.co/JyMwFtAeGG",
"expanded_url": "http://knip.dev",
"display_url": "knip.dev",
"status": 200,
"title": "Knip",
"description": "Project linter to find unused files, dependencies and exports in JavaScript and TypeScript projects",
"unwound_url": "https://knip.dev/"
},
{
"start": 239,
"end": 262,
"url": "https://t.co/bliep",
"display_url": "pic.twitter.com/uOuO1ch5ij",
"media_key": "1"
}
]
},
"id": "1745972825490604506",
"author_id": "1",
"created_at": "2024-01-13T01:55:00.000Z",
"attachments": { "media_keys": ["1"] },
"text": "warning: do not use a tool like https://t.co/JyMwFtAeGG + code search to delete a ton of unused code. It works too well.\n\nI just did this in https://github.com/sourcegraph/cody/pull/2705, and my boss said if I end the week with net negative lines of code committed, I'm in deep trouble. https://t.co/bliep",
"public_metrics": {
"retweet_count": 1,
"reply_count": 3,
"like_count": 13,
"quote_count": 1,
"bookmark_count": 3,
"impression_count": 933
}
},
{
"entities": {
"mentions": [
Expand Down Expand Up @@ -686,13 +723,24 @@
],
"includes": {
"media": [
{
"media_key": "1",
"url": "https://pbs.twimg.com/media/GDrwdB3aYAAu4am?format=png&name=orig",
"type": "photo"
},
{
"media_key": "3_1730179997682552832",
"url": "https://pbs.twimg.com/media/GALVin9a0AAsn0-.jpg",
"type": "photo"
}
],
"users": [
{
"id": "1",
"username": "sqs",
"profile_image_url": "https://pbs.twimg.com/profile_images/1519180377604034560/NxI03WYE_400x400.jpg",
"name": "Quinn Slack"
},
{
"id": "22918124",
"username": "gregberge_",
Expand Down
5 changes: 4 additions & 1 deletion packages/docs/src/components/Tweet.astro
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ const tweet: TweetWithUser = replaceShortenedUrls(Astro.props.data);
<title>retweets</title>
<use href={`${sprites.src}#retweets`} />
</svg>
<span>{tweet.public_metrics.retweet_count}</span>
<span>
{tweet.public_metrics.retweet_count +
tweet.public_metrics.quote_count}
</span>
</div>
<div>
<svg width="24" height="24">
Expand Down
1 change: 1 addition & 0 deletions packages/docs/src/components/Tweets.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const BEARER_TOKEN = import.meta.env.BEARER_TOKEN;
const isFetch = false;
const tweetIds = [
'1745972825490604506',
'1730180003453927560',
'1691460974518353920',
'1729181106715632088',
Expand Down
1 change: 1 addition & 0 deletions packages/docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Special thanks to the wonderful people who have contributed to this project!
:::section{.columns.min300}

- [Argos](https://github.com/argos-ci/argos)
- [sourcegraph/cody](https://github.com/sourcegraph/cody)
- [freeCodeCamp](https://github.com/freeCodeCamp/freeCodeCamp)
- [gajus/slonik](https://github.com/gajus/slonik)
- [JoshuaKGoldberg/create-typescript-app](https://github.com/JoshuaKGoldberg/create-typescript-app)
Expand Down

0 comments on commit ad224c4

Please sign in to comment.