Skip to content

Commit

Permalink
first upload
Browse files Browse the repository at this point in the history
  • Loading branch information
frxangelz committed Oct 13, 2021
1 parent 364e166 commit 1f90ed2
Show file tree
Hide file tree
Showing 16 changed files with 6,717 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
# igpostdelete
# igdeletepost

Unfortunately, there is no option to delete all posts On Instagram. If you want to get rid of everything you've ever posted on this platform, you will either need to continue doing this to each and every one of your posts.

with the help of this extension, you can delete all your posts on youtube without having to bother with manual clicks one by one. this script will do it, you just press the start button and you can let the computer work for you.

How to use and Demo : https://www.youtube.com/watch?v=KGm2qnL-ObU

I really hope for your support by subscribing to my youtube channel :
https://www.youtube.com/channel/UCqRqvw9n7Lrh79x3dRDOkDg

note: The extension may not work in the future if instagram changes their layout, in this case, you should subscribe to my channel to get an update for the new script.
66 changes: 66 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"l10nTabName": {
"message":"Localization"
,"description":"name of the localization tab"
}
,"l10nHeader": {
"message":"It does localization too! (this whole tab is, actually)"
,"description":"Header text for the localization section"
}
,"l10nIntro": {
"message":"'L10n' refers to 'Localization' - 'L' an 'n' are obvious, and 10 comes from the number of letters between those two. It is the process/whatever of displaying something in the language of choice. It uses 'I18n', 'Internationalization', which refers to the tools / framework supporting L10n. I.e., something is internationalized if it has I18n support, and can be localized. Something is localized for you if it is in your language / dialect."
,"description":"introduce the basic idea."
}
,"l10nProd": {
"message":"You <strong>are</strong> planning to allow localization, right? You have <em>no idea</em> who will be using your extension! You have no idea who will be translating it! At least support the basics, it's not hard, and having the framework in place will let you transition much more easily later on."
,"description":"drive the point home. It's good for you."
}
,"l10nFirstParagraph": {
"message":"When the options page loads, elements decorated with <strong>data-l10n</strong> will automatically be localized!"
,"description":"inform that <el data-l10n='' /> elements will be localized on load"
}
,"l10nSecondParagraph": {
"message":"If you need more complex localization, you can also define <strong>data-l10n-args</strong>. This should contain <span class='code'>$containerType$</span> filled with <span class='code'>$dataType$</span>, which will be passed into Chrome's i18n API as <span class='code'>$functionArgs$</span>. In fact, this paragraph does just that, and wraps the args in mono-space font. Easy!"
,"description":"introduce the data-l10n-args attribute. End on a lame note."
,"placeholders": {
"containerType": {
"content":"$1"
,"example":"'array', 'list', or something similar"
,"description":"type of the args container"
}
,"dataType": {
"content":"$2"
,"example":"string"
,"description":"type of data in each array index"
}
,"functionArgs": {
"content":"$3"
,"example":"arguments"
,"description":"whatever you call what you pass into a function/method. args, params, etc."
}
}
}
,"l10nThirdParagraph": {
"message":"Message contents are passed right into innerHTML without processing - include any tags (or even scripts) that you feel like. If you have an input field, the placeholder will be set instead, and buttons will have the value attribute set."
,"description":"inform that we handle placeholders, buttons, and direct HTML input"
}
,"l10nButtonsBefore": {
"message":"Different types of buttons are handled as well. &lt;button&gt; elements have their html set:"
}
,"l10nButton": {
"message":"in a <strong>button</strong>"
}
,"l10nButtonsBetween": {
"message":"while &lt;input type='submit'&gt; and &lt;input type='button'&gt; get their 'value' set (note: no HTML):"
}
,"l10nSubmit": {
"message":"a <strong>submit</strong> value"
}
,"l10nButtonsAfter": {
"message":"Awesome, no?"
}
,"l10nExtras": {
"message":"You can even set <span class='code'>data-l10n</span> on things like the &lt;title&gt; tag, which lets you have translatable page titles, or fieldset &lt;legend&gt; tags, or anywhere else - the default <span class='code'>Boil.localize()</span> behavior will check every tag in the document, not just the body."
,"description":"inform about places which may not be obvious, like <title>, etc"
}
}
48 changes: 48 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
var config = {
enable : 0,
total : 0
}

chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {

if (request.action == "set"){
config.enable = request.enable;
send_enable();
return;
}

if(request.action == "get"){
var message = {action: "set",
enable: config.enable,
total:config.total};
sendResponse(message);
return;
}

if(request.action == "inc"){
config.total++;
sendResponse({total:config.total});
return;
}

if(request.action == "log"){

console.log(request.log);
return;
}

});

function send_enable(){

chrome.tabs.query({}, function(tabs) {
var message = {action: "set",
enable: config.enable,
total:config.total};
for (var i=0; i<tabs.length; ++i) {
chrome.tabs.sendMessage(tabs[i].id, message);
}
});
}

Binary file added icons/icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/icon16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/icon19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/icon48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
231 changes: 231 additions & 0 deletions inject.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
/*
Delete all your comments on youtube
(c) 2021 - FreeAngel
youtube channel : http://www.youtube.com/channel/UC15iFd0nlfG_tEBrt6Qz1NQ
PLEASE SUBSCRIBE !
github : https://github.com/frxangelz/
*/

const _MAX_DELETE_TO_RELOAD = 40; // will reload page after certain amount of deletions
const _TIMEOUT_IN_SECS = 60;
const _DEFAULT_WAIT_TIME = 5;

tick_count = 0;
first = true;
delete_count = 0;

var CurActionUrl = "";
var _NO_POST_FOUND = false;

var config = {
enable : 0,
total : 0
}

var wait_time = _DEFAULT_WAIT_TIME;

var click_count = 0;

chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {

if (request.action === "set") {
config.enable = request.enable;
tick_count = 0;

if(!config.enable){
var info = document.getElementById("info_ex");
if(info) {
console.log("removed");
info.parentNode.removeChild(info);
}
first = true;
}
}

});

function show_info(){

var info = document.getElementById("info_ex");
if(!info) {

info = document.createElement('div');
info.style.cssText = "position: fixed; bottom: 0; width:100%; z-index: 999;background-color: #F5FACA; border-style: solid; border-width: 1px; margins: 5px; paddingLeft: 10px; paddingRight: 10px;";
info.innerHTML = "<center><h3 id='status_ex'>active</h3></center>";
info.id = "info_ex";
document.body.appendChild(info);
console.log("info_ex created");
}
}

function info(txt){

var info = document.getElementById("status_ex");
if(!info) { return; }
if(txt !== ""){ info.textContent = "Deleted : "+config.total+", "+txt; }
else { info.textContent = "Deleted : "+config.total; }
}

article = null;

function IsDialogOpen(){

var div = document.querySelector('div.pbNvD[role="dialog"]');
if (div) {return true;}
return false;
}

function IsInProfilePage(){
var div = document.querySelector('div.fx7hk[role="tablist"]');
return div != null ? true : false;
}

function ShowArticle(){
wait_time = _DEFAULT_WAIT_TIME;

article = document.querySelector('article.M9sTE');
if(article) {

if (!IsDialogOpen()) {
var btn = article.querySelector('button.wpO6b');
if(btn) {
btn.click();
console.log("ReClick dialog");
}
}

return;
}

var divs = document.querySelectorAll('div.eLAPa');

if((!divs) || (divs.length < 1)){

_NO_POST_FOUND = true;
wait_time = _TIMEOUT_IN_SECS;
console.log("No Post Found !");
return;
}

var found = false;

for(var i=0; i<divs.length; i++){

if(divs[i].getAttribute('signed') == 1){ continue; }
divs[i].setAttribute('signed',1);
divs[i].scrollIntoView();
divs[i].click();
found = true;
setTimeout(function(){
article = document.querySelector('article.M9sTE');
if(article){
var btn = article.querySelector('button.wpO6b');
if(btn) {
btn.click();
delete_count++;
chrome.runtime.sendMessage({action:"inc"},function(response){
config.total = response.total;
})
}
}
},500);
break;
}

if(!found) {
_NO_POST_FOUND = true;
wait_time = _TIMEOUT_IN_SECS;
console.log("No Post Found ...!");
return;
}
}

function DeletePost(){

var btns = document.querySelectorAll('button.aOOlW');
if((!btns) || (btns.length < 1)){

return false;
}

var b = false;
for(var i=0; i<btns.length; i++){

if(btns[i].textContent === "Delete"){

console.log("found Delete Button !");
b = true;
//btns[i].click();
break;
}
}

return b;
}

var loading_tick_count = 0;
var InProfilePage = false;

var readyStateCheckInterval = setInterval(function() {

if (document.readyState !== "complete") { return; }

if(first){
first = false;
chrome.runtime.sendMessage({action: "get"}, function(response){

config.enable = response.enable;
config.total = response.total;
});
}

if(!config.enable) { return; }

cur_url = //$(location).attr('href');
window.location.href;

tick_count= tick_count+1;

if(cur_url.indexOf("instagram.com/") === -1){
return;
}

show_info();

if(DeletePost()) {
return;
}

if(wait_time > 0){
// sedang dalam proses menanti
wait_time--;
if(InProfilePage){ info("Wait for "+wait_time.toString()+"s"); }
return;
}

InProfilePage = IsInProfilePage();

if(!InProfilePage){
return;
}

if(_NO_POST_FOUND){
window.location.href = cur_url;
return;
}

if(delete_count >= _MAX_DELETE_TO_RELOAD){

window.location.href = cur_url;
return;
}

ShowArticle();

info("");

}, 1000);

6 changes: 6 additions & 0 deletions jquery.min.js

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "Delete Instagram Posts : by freeangel",
"background": {
"scripts": [
"background.js"
]
},
"version": "0.0.1",
"manifest_version": 2,
"description": "Macro to delete all your Posts/photo on Instagram",
"homepage_url": "https://www.youtube.com/channel/UCqRqvw9n7Lrh79x3dRDOkDg",
"default_locale": "en",
"browser_action": {
"default_title": "delete all Your Instagram Posts",
"default_popup": "popup/popup.html"
},
"permissions": [
"background",
"https://instagram.com/*",
"https://*.instagram.com/*"
],
"content_scripts": [
{
"matches": [
"<all_urls>"
],
"js": [
"jquery.min.js",
"inject.js"
]
}
]
}
Loading

0 comments on commit 1f90ed2

Please sign in to comment.