diff --git a/.gitignore b/.gitignore index d0c5794..c15edbd 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ Extensions/combined/bundled-content-script.js # Dist Files Extensions/combined/dist/* package-lock.json +Website/package-lock.json diff --git a/Extensions/combined/debug.js b/Extensions/combined/debug.js new file mode 100644 index 0000000..4bff57f --- /dev/null +++ b/Extensions/combined/debug.js @@ -0,0 +1,8 @@ +//--- Get Extension Information ---// +const extension = chrome.runtime.getManifest(); + +//--- Get Debug Elements ---// +const ver = document.getElementById("extension-version"); + +//--- Set Debug Elements ---// +ver.innerHTML = extension.version; \ No newline at end of file diff --git a/Extensions/combined/manifest-chrome.json b/Extensions/combined/manifest-chrome.json index bc00d83..d1cf586 100644 --- a/Extensions/combined/manifest-chrome.json +++ b/Extensions/combined/manifest-chrome.json @@ -27,6 +27,10 @@ "exclude_matches": ["*://*.music.youtube.com/*"], "js": ["bundled-content-script.js"], "css": ["content-style.css"] + }, + { + "matches": ["*://*.returnyoutubedislike.com/debug","http://localhost/debug"], + "js": ["debug.js"] } ], "externally_connectable": { diff --git a/Extensions/combined/manifest-firefox.json b/Extensions/combined/manifest-firefox.json index c0f2941..e0e8dba 100644 --- a/Extensions/combined/manifest-firefox.json +++ b/Extensions/combined/manifest-firefox.json @@ -21,6 +21,11 @@ "run_at": "document_idle", "css": ["content-style.css"], "js": ["bundled-content-script.js"] + }, + { + "matches": ["*://*.returnyoutubedislike.com/debug","http://localhost/debug"], + "run_at": "document_idle", + "js": ["debug.js"] } ] } diff --git a/README.md b/README.md index ed35ee6..32fb2af 100644 --- a/README.md +++ b/README.md @@ -36,35 +36,8 @@ You can learn more at our website at: [returnyoutubedislike.com](https://www.ret ## API documentation -Third party use of this open API is allowed with the following restrictions: - -- **Attribution**: This project should be clearly attributed with either a link to this repo or a link to [returnyoutubedislike.com](https://returnyoutubedislike.com/). -- **Rate Limiting**: There are per client rate limits in place of 100 per minute and 10'000 per day. This will return a *429* status code indicating that your application should back off. - -The API is accessible over the following base URL: -https://returnyoutubedislikeapi.com - -List of available endpoints is available here: -https://returnyoutubedislikeapi.com/swagger/index.html - -### Get votes -Example to get votes of a given YouTube video ID: -`/votes?videoId=kxOuG8jMIgI` - -```json -{ - "id": "kxOuG8jMIgI", - "dateCreated": "2021-12-20T12:25:54.418014Z", - "likes": 27326, - "dislikes": 498153, - "rating": 1.212014408444885, - "viewCount": 3149885, - "deleted": false -} -``` - -None existing YouTube ID will return status code *404* "Not Found". -Wrong formed YouTube ID will return *400* "Bad Request". +You can view all documentation on our website. +[https://returnyoutubedislike.com/documentation/](https://returnyoutubedislike.com/documentation/) ## HELP WANTED diff --git a/Website/layouts/default.vue b/Website/layouts/default.vue index 828216f..f986e48 100644 --- a/Website/layouts/default.vue +++ b/Website/layouts/default.vue @@ -31,26 +31,12 @@ export default { data: () => ({ links: [ - { - name: "Home", - path: "/", - }, - { - name: "Install", - path: "/install", - }, - { - name: "FAQ", - path: "/faq", - }, - { - name: "Donate", - path: "/donate", - }, - { - name: "Links", - path: "/links", - }, + { name: "Home", path: "/" }, + { name: "Install", path: "/install" }, + { name: "FAQ", path: "/faq" }, + { name: "Donate", path: "/donate" }, + { name: "Links", path: "/links" }, + { name: "API", path: "/documentation" }, ], }), }; diff --git a/Website/nuxt.config.js b/Website/nuxt.config.js index 9860f32..165bff8 100644 --- a/Website/nuxt.config.js +++ b/Website/nuxt.config.js @@ -27,12 +27,18 @@ export default { ], }, + env: { + apiUrl: "https://returnyoutubedislikeapi.com", + }, + + //server: { host: '0.0.0.0', port: 80 }, //LINE FOR DEBUGGING ONLY + target: "static", css: [], plugins: [], components: true, buildModules: ["@nuxtjs/vuetify"], - modules: [], + modules: ["nuxt-user-agent"], // Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify vuetify: { @@ -52,7 +58,7 @@ export default { }, }, }, - + /* build: { extend(config, ctx) { // Run ESLint on save (dev-only) @@ -65,5 +71,6 @@ export default { }); } }, - }, + } +*/ }; diff --git a/Website/package-lock.json b/Website/package-lock.json index a9adf2f..3dca403 100644 --- a/Website/package-lock.json +++ b/Website/package-lock.json @@ -10,9 +10,11 @@ "dependencies": { "core-js": "^3.15.1", "nuxt": "^2.15.7", + "nuxt-user-agent": "^1.2.2", "vuetify": "^2.5.5" }, "devDependencies": { + "@nuxtjs/device": "^2.1.0", "@nuxtjs/vuetify": "^1.12.1", "babel-eslint": "^10.1.0", "eslint": "^7.32.0", @@ -2643,6 +2645,21 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, + "node_modules/@nuxtjs/device": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@nuxtjs/device/-/device-2.1.0.tgz", + "integrity": "sha512-TYBdt1w2bmCCWp+MhgcBATZtqyUBi3nSdNpcLGILw5USLwCsC/yZtIkq9YisuEzuRnod9w/RZpoE80MxLftEuA==", + "dev": true, + "dependencies": { + "defu": "^3.2.2" + } + }, + "node_modules/@nuxtjs/device/node_modules/defu": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/defu/-/defu-3.2.2.tgz", + "integrity": "sha512-8UWj5lNv7HD+kB0e9w77Z7TdQlbUYDVWqITLHNqFIn6khrNHv5WQo38Dcm1f6HeNyZf0U7UbPf6WeZDSdCzGDQ==", + "dev": true + }, "node_modules/@nuxtjs/vuetify": { "version": "1.12.1", "resolved": "https://registry.npmjs.org/@nuxtjs/vuetify/-/vuetify-1.12.1.tgz", @@ -8914,6 +8931,14 @@ "nuxt": "bin/nuxt.js" } }, + "node_modules/nuxt-user-agent": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/nuxt-user-agent/-/nuxt-user-agent-1.2.2.tgz", + "integrity": "sha512-Z9d+r1/PzJAvrr4rX70IWvRyI3qw3RukAGrRZPZ9WeByuCWmVKiW8G1AhdkUOyrDrVoBUC59iLqIVkop/NjSuQ==", + "dependencies": { + "woothee": "^1.8.1" + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -14548,6 +14573,11 @@ "node": ">=8" } }, + "node_modules/woothee": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/woothee/-/woothee-1.11.1.tgz", + "integrity": "sha512-KdArM3MsNa5tlSBSL29w9ouy9MXZoFPeUdPVnL4QZH3iyV8HsqnwbWw2YLiXEx2wAh0bM55dnl0+qDE6KHBlhQ==" + }, "node_modules/word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -16628,6 +16658,23 @@ } } }, + "@nuxtjs/device": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@nuxtjs/device/-/device-2.1.0.tgz", + "integrity": "sha512-TYBdt1w2bmCCWp+MhgcBATZtqyUBi3nSdNpcLGILw5USLwCsC/yZtIkq9YisuEzuRnod9w/RZpoE80MxLftEuA==", + "dev": true, + "requires": { + "defu": "^3.2.2" + }, + "dependencies": { + "defu": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/defu/-/defu-3.2.2.tgz", + "integrity": "sha512-8UWj5lNv7HD+kB0e9w77Z7TdQlbUYDVWqITLHNqFIn6khrNHv5WQo38Dcm1f6HeNyZf0U7UbPf6WeZDSdCzGDQ==", + "dev": true + } + } + }, "@nuxtjs/vuetify": { "version": "1.12.1", "resolved": "https://registry.npmjs.org/@nuxtjs/vuetify/-/vuetify-1.12.1.tgz", @@ -21504,6 +21551,14 @@ "@nuxt/webpack": "2.15.8" } }, + "nuxt-user-agent": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/nuxt-user-agent/-/nuxt-user-agent-1.2.2.tgz", + "integrity": "sha512-Z9d+r1/PzJAvrr4rX70IWvRyI3qw3RukAGrRZPZ9WeByuCWmVKiW8G1AhdkUOyrDrVoBUC59iLqIVkop/NjSuQ==", + "requires": { + "woothee": "^1.8.1" + } + }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -25917,6 +25972,11 @@ "string-width": "^4.0.0" } }, + "woothee": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/woothee/-/woothee-1.11.1.tgz", + "integrity": "sha512-KdArM3MsNa5tlSBSL29w9ouy9MXZoFPeUdPVnL4QZH3iyV8HsqnwbWw2YLiXEx2wAh0bM55dnl0+qDE6KHBlhQ==" + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", diff --git a/Website/package.json b/Website/package.json index c16dbf1..03b6ce9 100644 --- a/Website/package.json +++ b/Website/package.json @@ -12,6 +12,7 @@ "dependencies": { "core-js": "^3.15.1", "nuxt": "^2.15.7", + "nuxt-user-agent": "^1.2.2", "vuetify": "^2.5.5" }, "devDependencies": { diff --git a/Website/pages/debug.vue b/Website/pages/debug.vue new file mode 100644 index 0000000..fbdfc50 --- /dev/null +++ b/Website/pages/debug.vue @@ -0,0 +1,68 @@ + + + diff --git a/Website/pages/documentation.vue b/Website/pages/documentation.vue new file mode 100644 index 0000000..ff21a68 --- /dev/null +++ b/Website/pages/documentation.vue @@ -0,0 +1,60 @@ + + + diff --git a/Website/pages/documentation/endpoints.vue b/Website/pages/documentation/endpoints.vue new file mode 100644 index 0000000..ef94c10 --- /dev/null +++ b/Website/pages/documentation/endpoints.vue @@ -0,0 +1,19 @@ + + + diff --git a/Website/pages/documentation/fetching.vue b/Website/pages/documentation/fetching.vue new file mode 100644 index 0000000..651f2b8 --- /dev/null +++ b/Website/pages/documentation/fetching.vue @@ -0,0 +1,78 @@ + + + + + diff --git a/Website/pages/documentation/index.vue b/Website/pages/documentation/index.vue new file mode 100644 index 0000000..ad3cd1d --- /dev/null +++ b/Website/pages/documentation/index.vue @@ -0,0 +1,8 @@ + diff --git a/Website/pages/documentation/url.vue b/Website/pages/documentation/url.vue new file mode 100644 index 0000000..e95f542 --- /dev/null +++ b/Website/pages/documentation/url.vue @@ -0,0 +1,17 @@ + + + diff --git a/Website/pages/documentation/usage-rights.vue b/Website/pages/documentation/usage-rights.vue new file mode 100644 index 0000000..09bf581 --- /dev/null +++ b/Website/pages/documentation/usage-rights.vue @@ -0,0 +1,30 @@ + + + diff --git a/Website/pages/faq.vue b/Website/pages/faq.vue index 9ce4693..9a75b79 100644 --- a/Website/pages/faq.vue +++ b/Website/pages/faq.vue @@ -49,8 +49,7 @@ export default { "The extension collects the video ID of the video you are watching, fetches the dislike (and other fields like views, likes etc) using our API. The extension then displays the dislike count and ratio on the page. If you dislike or like a video, that is recorded and sent to the database so an accurate dislike count can be extrapolated.", }, { - question: - "Can I share my dislke count with you?", + question: "Can I share my dislke count with you?", answer: "Coming soon. We are looking into using Oauth or a different read only API with a limited scope so creators can share their dislike counts verifiability. ", }, diff --git a/Website/pages/index.vue b/Website/pages/index.vue index 4a2f118..46810c0 100644 --- a/Website/pages/index.vue +++ b/Website/pages/index.vue @@ -97,8 +97,14 @@ export default { { name: "Piepacker", link: "https://piepacker.com/" }, { name: "nodetube", link: "https://github.com/mayeaux/nodetube" }, { name: "trig404" }, - { name: "Peter33", link: "https://www.youtube.com/watch?v=G5kzUpWAusI" }, - { name: "Seed4.Me VPN", link: "https://www.seed4.me/users/register?gift=ReturnYoutubeDislike" }, + { + name: "Peter33", + link: "https://www.youtube.com/watch?v=G5kzUpWAusI", + }, + { + name: "Seed4.Me VPN", + link: "https://www.seed4.me/users/register?gift=ReturnYoutubeDislike", + }, ], }; },