Skip to content

Commit

Permalink
deploy via script
Browse files Browse the repository at this point in the history
  • Loading branch information
kaangiray26 committed Jun 28, 2023
1 parent 8042629 commit 4f257b7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/pages/Post.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,24 @@
import { ref, onBeforeMount, onActivated } from 'vue';
import { useRouter } from 'vue-router';
import { CapacitorHttp } from '@capacitor/core';
import { extractors } from "https://kaangiray26.github.io/endless/src/js/extractors.min.js";
import Post from '/components/SinglePost.vue';
const router = useRouter();
const extractors = ref([]);
const ex = ref(null);
const item = ref(null);
async function setup() {
// Get the extractor script
let js = await fetch(extractors.value[router.currentRoute.value.params.domain].url)
.then(res => res.text())
.then(res => res + "return extractor();")
.catch(err => null);
ex.value = new Function(js)();
// Get post
let response = await ex.value.get_post(router.currentRoute.value.params.id.join("/"), CapacitorHttp);
if (!response) {
return;
Expand All @@ -29,7 +38,7 @@ async function setup() {
onBeforeMount(() => {
// Set the extractor
ex.value = extractors[router.currentRoute.value.params.domain];
extractors.value = JSON.parse(localStorage.getItem('list'));
// Run setup
setup();
Expand Down

0 comments on commit 4f257b7

Please sign in to comment.