-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from zernonia/change-api-to-syndication
Use Twitter's Syndication to extract content
- Loading branch information
Showing
19 changed files
with
988 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<script setup lang="ts"> | ||
defineProps({ | ||
method: String, | ||
url: String, | ||
description: String, | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div class="mt-20"> | ||
<div class="relative flex items-center p-2 bg-light-600 rounded-xl"> | ||
<div class="tag bg-blue-500 mr-4">{{ method }}</div> | ||
<div>{{ url }}</div> | ||
<span class="absolute text-sm text-gray-400 right-4 top-full md:top-auto">{{ description }}</span> | ||
</div> | ||
|
||
<div class="flex flex-col md:flex-row mt-12 md:space-x-6"> | ||
<div class="md:w-1/2 flex flex-col"> | ||
<div class="flex flex-col"> | ||
<h4 class="text-xl font-semibold mb-4 text-gray-400">Query Params</h4> | ||
<slot name="config"></slot> | ||
</div> | ||
|
||
<div class="flex flex-col"> | ||
<h4 class="mt-20 text-xl font-semibold mb-4 text-gray-400">Results</h4> | ||
<div class="tag bg-green-500">200</div> | ||
|
||
<div class="mt-4"> | ||
<slot name="result"></slot> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="min-h-80 md:w-1/2 p-4 md:p-8 mt-4 md:mt-0 rounded-2xl bg-light-600"> | ||
<slot name="preview"></slot> | ||
</div> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<script setup lang="ts"> | ||
const params = ref({ | ||
url: "https://twitter.com/zernonia/status/1524620865987506176", | ||
layout: "", | ||
css: "tailwind", | ||
enable_twemoji: true, | ||
show_media: true, | ||
show_quoted_tweet: true, | ||
show_info: true, | ||
}) | ||
const { $hljs } = useNuxtApp() | ||
const tweetRef = ref() | ||
const highlightResponse = computed(() => | ||
tweetRef.value?.data | ||
? $hljs.highlight(JSON.stringify(tweetRef.value.data, null, " "), { language: "json", ignoreIllegals: false }) | ||
.value | ||
: "" | ||
) | ||
</script> | ||
|
||
<template> | ||
<DocsBase method="GET" url="https://tweetic.io/api/tweet" description="Obtain static tweets"> | ||
<template #config> | ||
<label for="url">url</label> | ||
<input type="text" name="url" id="url" v-model="params.url" /> | ||
<label class="mt-2" for="layout">layout <span class="description"> ("" | "supabase")</span></label> | ||
<select v-model="params.layout" name="layout" id="layout"> | ||
<option value="">Default</option> | ||
<option value="supabase">Supabase</option> | ||
</select> | ||
<label class="mt-2" for="css">css <span class="description"> ("" | "tailwind")</span></label> | ||
<select v-model="params.css" name="css" id="css"> | ||
<option value="">Default CSS</option> | ||
<option value="tailwind">Tailwind</option> | ||
</select> | ||
|
||
<Toggle class="mt-2" name="enable_twemoji" v-model="params.enable_twemoji"> enable_twemoji </Toggle> | ||
<Toggle class="mt-2" name="show_media" v-model="params.show_media"> show_media </Toggle> | ||
<Toggle class="mt-2" name="show_quoted_tweet" v-model="params.show_quoted_tweet"> show_quoted_tweet </Toggle> | ||
<Toggle class="mt-2" name="show_info" v-model="params.show_info"> show_info </Toggle> | ||
</template> | ||
|
||
<template #result> | ||
<p>html - <span class="description">HTML that are ready to render</span></p> | ||
<p>meta - <span class="description">Meta data from Twitter</span></p> | ||
</template> | ||
|
||
<template #preview> | ||
<div class="flex justify-center"> | ||
<Tweet ref="tweetRef" v-bind="params"></Tweet> | ||
</div> | ||
<pre class="overflow-x-scroll text-gray-400 mt-4 text-sm" v-html="highlightResponse"></pre> | ||
</template> | ||
</DocsBase> | ||
</template> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,5 @@ | ||
<script setup lang="ts"> | ||
const params = ref({ | ||
url: "https://twitter.com/zernonia/status/1524620865987506176", | ||
layout: "supabase", | ||
css: "tailwind", | ||
show_original_link: false, | ||
enable_twemoji: true, | ||
}) | ||
const { $hljs } = useNuxtApp() | ||
const tweetRef = ref() | ||
const highlightResponse = computed(() => | ||
tweetRef.value?.data | ||
? $hljs.highlight(JSON.stringify(tweetRef.value.data, null, " "), { language: "json", ignoreIllegals: false }) | ||
.value | ||
: "" | ||
) | ||
</script> | ||
|
||
<template> | ||
<div class="mt-20"> | ||
<div class="relative flex items-center p-2 bg-light-600 rounded-xl"> | ||
<div class="tag bg-blue-500 mr-4">GET</div> | ||
<div>https://tweetic.io/api/tweets</div> | ||
<span class="absolute text-sm text-gray-400 right-4 top-full md:top-auto">Obtain static tweets</span> | ||
</div> | ||
|
||
<div class="flex flex-col md:flex-row mt-12 md:space-x-6"> | ||
<div class="md:w-1/2 flex flex-col"> | ||
<div class="flex flex-col"> | ||
<h4 class="text-xl font-semibold mb-4 text-gray-400">Query Params</h4> | ||
<label for="url">url</label> | ||
<input type="text" name="url" id="url" v-model="params.url" /> | ||
<label class="mt-2" for="layout">layout <span class="description"> ("" | "supabase")</span></label> | ||
<select v-model="params.layout" name="layout" id="layout"> | ||
<option value="">Default</option> | ||
<option value="supabase">Supabase</option> | ||
</select> | ||
<label class="mt-2" for="css">css <span class="description"> ("" | "tailwind")</span></label> | ||
<select v-model="params.css" name="css" id="css"> | ||
<option value="">Default CSS</option> | ||
<option value="tailwind">Tailwind</option> | ||
</select> | ||
|
||
<Toggle class="mt-2" name="show_original_link" v-model="params.show_original_link"> | ||
show_original_link | ||
</Toggle> | ||
<Toggle class="mt-2" name="enable_twemoji" v-model="params.enable_twemoji"> enable_twemoji </Toggle> | ||
</div> | ||
|
||
<div class="flex flex-col"> | ||
<h4 class="mt-20 text-xl font-semibold mb-4 text-gray-400">Results</h4> | ||
<div class="tag bg-green-500">200</div> | ||
|
||
<div class="mt-4"> | ||
<p>html - <span class="description">HTML that are ready to render</span></p> | ||
<p>oembed - <span class="description">Oembed information from Twitter</span></p> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="min-h-80 md:w-1/2 p-4 md:p-8 mt-4 md:mt-0 rounded-2xl bg-light-600"> | ||
<div class="flex justify-center"> | ||
<Tweet ref="tweetRef" v-bind="params"></Tweet> | ||
</div> | ||
<pre class="overflow-x-scroll text-gray-400 mt-4 text-sm" v-html="highlightResponse"></pre> | ||
</div> | ||
</div> | ||
<div> | ||
<DocsTweet></DocsTweet> | ||
</div> | ||
</template> |
Oops, something went wrong.
96181c4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
tweetic – ./
tweetic-zernonia.vercel.app
tweetic.io
tweetic-git-master-zernonia.vercel.app
static-tweet-tan.vercel.app
www.tweetic.io