Skip to content

Commit

Permalink
formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
Unic-X committed May 21, 2021
1 parent 06cf082 commit e0ebf13
Show file tree
Hide file tree
Showing 4 changed files with 283 additions and 238 deletions.
214 changes: 103 additions & 111 deletions content.js
Original file line number Diff line number Diff line change
@@ -1,94 +1,96 @@
var title = document.getElementsByTagName("title")[0].innerHTML;

var title = document.getElementsByTagName("title")[0].innerHTML

class AnimePahe{
constructor(){
this.name=null;
this.episode=null;
this.isPaused=true;
}
animepaheNameEpisode(str) {
let anime = str.split("::")[0];
let [name,episode]=anime.split("Ep.");
const intEp=parseInt(episode);
this.name=name;this.episode=intEp;
return({
name,intEp
})
}
showAnimeName(){
return this.name;
}
showAnimeEpisode(){
return this.episode;
}
class AnimePahe {
constructor() {
this.name = null;
this.episode = null;
this.isPaused = true;
}
animepaheNameEpisode(str) {
let anime = str.split("::")[0];
let [name, episode] = anime.split("Ep.");
const intEp = parseInt(episode);
this.name = name;
this.episode = intEp;
return {
name,
intEp,
};
}
showAnimeName() {
return this.name;
}
showAnimeEpisode() {
return this.episode;
}

isLoaded() {
document.querySelector(".click-to-load").addEventListener("click",()=>
{
console.log(`%c Player is Now Loaded!', 'font-weight: bold; font-size: 50px;color: red; text-shadow: 3px 3px 0 rgb(217,31,38) ,
isLoaded() {
document.querySelector(".click-to-load").addEventListener("click", () => {
console.log(`%c Player is Now Loaded!', 'font-weight: bold; font-size: 50px;color: red; text-shadow: 3px 3px 0 rgb(217,31,38) ,
6px 6px 0 rgb(226,91,14) , 9px 9px 0 rgb(245,221,8) , 12px 12px 0 rgb(5,148,68) , 15px 15px 0 rgb(2,135,206) ,
18px 18px 0 rgb(4,77,145) , 21px 21px 0 rgb(42,21,113)`);
return true;
})
}
return true;
});
}
}

class Gogoanime{
constructor(){
//Gets the title name directly from the div which has
this.name=null;
this.episode=null;
}
class Gogoanime {
constructor() {
//Gets the title name directly from the div which has
this.name = null;
this.episode = null;
}

gogoanimeEpisode(str){
//SEIJO NO MARYOKU WA BANNOU DESU EPISODE 7 ENGLISH SUBBED
let [animeName,strEp]=str.split("Episode");
const intEp=parseInt(strEp);
this.name=animeName;this.episode=intEp;
return({
animeName,intEp
})
}
gogoanimeEpisode(str) {
//SEIJO NO MARYOKU WA BANNOU DESU EPISODE 7 ENGLISH SUBBED
let [animeName, strEp] = str.split("Episode");
const intEp = parseInt(strEp);
this.name = animeName;
this.episode = intEp;
return {
animeName,
intEp,
};
}
}

//Checks whether the URL contains the site name
function containsURL(str) {
if(window.location.href.includes(str)){
return true;
}
else{
return false;
}
if (window.location.href.includes(str)) {
return true;
} else {
return false;
}
}

//Not a good name but checks which site and returns the instance of the site class wrapper
function alogund(){
if(containsURL("animepahe")){
console.log("Hello Wawwaad");
return new AnimePahe;
}else if(containsURL("gogoanime")){
console.log(title);
title=document.getElementsByClassName("title_name")[0].children[0].textContent;
return new Gogoanime;
}else{
//pass
}
function alogund() {
if (containsURL("animepahe")) {
console.log("Hello Wawwaad");
return new AnimePahe();
} else if (containsURL("gogoanime")) {
console.log(title);
title =
document.getElementsByClassName("title_name")[0].children[0].textContent;
return new Gogoanime();
} else {
//pass
}
}

//Returns the name based on the site
function toAnimeName(w){
if(alogund() instanceof AnimePahe ){
let a=alogund().animepaheNameEpisode(w);
console.log(a.name+"| "+a.intEp);
return a.name;
}else if(alogund() instanceof Gogoanime){
let a=alogund().gogoanimeEpisode(w);
console.log(a.animeName+"| "+a.intEp)
return a.animeName
}else{
//pass
}
function toAnimeName(w) {
if (alogund() instanceof AnimePahe) {
let a = alogund().animepaheNameEpisode(w);
console.log(a.name + "| " + a.intEp);
return a.name;
} else if (alogund() instanceof Gogoanime) {
let a = alogund().gogoanimeEpisode(w);
console.log(a.animeName + "| " + a.intEp);
return a.animeName;
} else {
//pass
}
}
//Returns the anime name with the Episode no.

Expand All @@ -103,52 +105,42 @@ query ($id: Int, $page: Int, $perPage: Int, $search: String) {
`;

let variables = {
search: toAnimeName(title),
page: 1,
perPage: 1
search: toA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WSE0GK2WhO7_enpwlfeF5UpgkGB-kgb0nBMguf8fii2E52i-Av2UgsJDFSC7O15W29tnrUVMJ0GMZHA4gvnObig_y
cm5FZ5GoTMitZujVe7XwIovF_GzORzNVmqrlfsm8xKzuYT8`,*/
'Content-Type': 'application/json',
'Accept': 'application/json'
},
body: JSON.stringify({
query: query,
variables: variables
})
};
var url = "https://graphql.anilist.co",
options = {
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
},
body: JSON.stringify({
query: query,
variables: variables,
}),
};

function handleResponse(response) {
return response.json().then(function (json) {
return response.ok ? json : Promise.reject(json);
});
return response.json().then(function (json) {
return response.ok ? json : Promise.reject(json);
});
}

function handleData(data) {
return data;
return data;
}

async function chutiya(){
let a = await fetch(url, options).then(handleResponse)
async function chutiya() {
let a = await fetch(url, options)
.then(handleResponse)
.then(handleData)
.catch((error)=>{
console.warn(error);
.catch((error) => {
console.warn(error);
});
console.log(a);
console.log(a);
}
Promise.resolve(chutiya())

Promise.resolve(chutiya());
83 changes: 56 additions & 27 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,36 +1,65 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Redirected Link</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<head>
<div class="fbox">
<div id="github">Github</div>
<div id="twitter">Twitter</div>
</div>
<section class="social">
<ul class="social-set">
<li>
<a class="sociali" href="#" target="_blank" aria-label="Twitter">
<i class="fa fa-twitter fa-fw" title="Twitter"></i
></a>
</li>
<li>
<a class="sociali" href="#" target="_blank" aria-label="GitHub">
<i class="fa fa-github-square fa-fw" title="GitHub"></i
></a>
</li>
<li>
<a class="sociali" href="#" target="_blank" aria-label="YouTube">
<i class="fa fa-youtube fa-fw" title="YouTube"></i
></a>
</li>
<li>
<a class="sociali" href="#" target="_blank" aria-label="Instagram">
<i class="fa fa-instagram fa-fw" title="Instagram"></i
></a>
</li>
<li>
<a class="sociali" href="#" target="_blank" aria-label="Facebook">
<i class="fa fa-facebook-square fa-fw" title="Facebook"></i
></a>
</li>
</ul>
</section>
</head>
<main>
<div>
<p>Thanks for the login u can now close this page </p>
</div>
<div>
<p>Thanks for the login u can now close this page</p>
</div>
</main>
<footer>
<div class="about-section">
<div class="inner-container">
<h1>About Us</h1>
<p class="text">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloribus velit ducimus, enim inventore earum, eligendi nostrum pariatur necessitatibus eius dicta a voluptates sit deleniti autem error eos totam nisi neque voluptates sit deleniti autem error eos totam nisi neque.
</p>
<div class="skills">
<span>Web Design</span>
<span>Photoshop & Illustrator</span>
<span>Coding</span>
</div>
</div>
<div class="about-section">
<div class="inner-container">
<h1>About Us</h1>
<p class="text">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloribus
velit ducimus, enim inventore earum, eligendi nostrum pariatur
necessitatibus eius dicta a voluptates sit deleniti autem error eos
totam nisi neque voluptates sit deleniti autem error eos totam nisi
neque.
</p>
<div class="skills">
<span>Web Design</span>
<span>Photoshop & Illustrator</span>
<span>Coding</span>
</div>
</div>
</div>
</footer>
</body>
</html>
</body>
</html>
48 changes: 23 additions & 25 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
{
"name": "Anilist",
"description": "Sends Anilist API a post request",
"version": "1.0",
"manifest_version": 2,
"background": {
"service_worker": "bg.js"
},

"icons": {
"128": "assets/ani.png"
},
"permissions": [
"tabs"
],
"content_scripts":[
{
"matches":[
"*://animepahe.com/play*",
"*://animepahe.org/play*",
"*://www1.gogoanime.ai/*"
],
"js":["content.js"]
}
]
}
"name": "Anilist",
"description": "Sends Anilist API a post request",
"version": "1.0",
"manifest_version": 2,
"background": {
"service_worker": "bg.js"
},

"icons": {
"128": "assets/ani.png"
},
"permissions": ["tabs"],
"content_scripts": [
{
"matches": [
"*://animepahe.com/play*",
"*://animepahe.org/play*",
"*://www1.gogoanime.ai/*"
],
"js": ["content.js"]
}
]
}
Loading

0 comments on commit e0ebf13

Please sign in to comment.