{"id":26022979,"url":"https://github.com/agrison/clean-fb-wall","last_synced_at":"2026-03-11T00:03:32.623Z","repository":{"id":145287237,"uuid":"26226149","full_name":"agrison/clean-fb-wall","owner":"agrison","description":"Clean your Facebook Wall","archived":false,"fork":false,"pushed_at":"2014-11-06T04:47:35.000Z","size":124,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-06T10:43:05.068Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agrison.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-05T15:37:27.000Z","updated_at":"2014-11-06T09:56:37.000Z","dependencies_parsed_at":"2023-04-20T22:17:48.467Z","dependency_job_id":null,"html_url":"https://github.com/agrison/clean-fb-wall","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/agrison/clean-fb-wall","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrison%2Fclean-fb-wall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrison%2Fclean-fb-wall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrison%2Fclean-fb-wall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrison%2Fclean-fb-wall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agrison","download_url":"https://codeload.github.com/agrison/clean-fb-wall/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrison%2Fclean-fb-wall/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30362723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"ssl_error","status_checked_at":"2026-03-10T21:40:59.357Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-06T10:37:40.155Z","updated_at":"2026-03-11T00:03:32.591Z","avatar_url":"https://github.com/agrison.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"Clean your Facebook Wall\n=============\n\n## Process\n\nAdd a bookmark to your Chrome with the following content:\n\n    javascript:!function(){function e(){holder=document.createElement(\"div\"),holder.id=\"fbwd\",firstStory=document.querySelector(\"div.lastCapsule\").nextSibling,holder.className=firstStory.className+\" \"+firstStory.querySelector(\"div\").className,newPost=document.querySelector(\"div.timelineUnitContainer\").querySelector('button[type=\"submit\"]'),innerHTML='\u003cdiv style=\"text-align:center\"\u003e\u003ch2 style=\"color:#3b5998;text-align:center;font-size:2em;margin-bottom:5px;\"\u003eFacebook wall delete\u003c/h2\u003e\u003cbr/\u003e',innerHTML+='\u003cp style=\"font-size:1.25em\"\u003e',innerHTML+='\u003cspan style=\"color: #6a7480; font-weight:bold\"\u003eCurrent status:\u003c/span\u003e ',innerHTML+='\u003cspan style=\"color: #3b5998\" id=\"currentStatus\"\u003eWaiting...\u003c/span\u003e',innerHTML+=\"\u003c/p\u003e\",innerHTML+='\u003cp style=\"font-size:1.25em\"\u003e',innerHTML+='\u003cspan style=\"color: #6a7480; font-weight:bold\"\u003ePopups activated:\u003c/span\u003e ',innerHTML+='\u003cspan style=\"color: #3b5998\" id=\"activatedPopups\"\u003e0\u003c/span\u003e',innerHTML+=\"\u003c/p\u003e\",innerHTML+='\u003cp style=\"font-size:1.25em\"\u003e',innerHTML+='\u003cspan style=\"color: #6a7480; font-weight:bold\"\u003eStories to delete:\u003c/span\u003e ',innerHTML+='\u003cspan style=\"color: #3b5998\" id=\"storiesToDelete\"\u003e0\u003c/span\u003e',innerHTML+=\"\u003c/p\u003e\",innerHTML+=\"\u003cp\u003e\",innerHTML+='\u003cbutton id=\"continueDeletion\" class=\"'+newPost.className+'\"\u003eCLEAN MY WALL !\u003c/button\u003e',innerHTML+=\"\u003c/p\u003e\",innerHTML+=\"\u003c/div\u003e\",holder.innerHTML=innerHTML,document.querySelector(\"div.lastCapsule\").appendChild(holder)}window.fbwd={},window.fbwd.scroll=0,window.fbwd.scrollAttempts=0,window.fbwd.eventFire=function(e,o){if(e.fireEvent)e.fireEvent(\"on\"+o);else{var t=document.createEvent(\"Events\");t.initEvent(o,!0,!1),e.dispatchEvent(t)}},window.fbwd.click=function(e){window.fbwd.eventFire(e,\"click\")},window.fbwd.clickAll=function(e,o){for(i=0;i\u003ce.length;++i)window.fbwd.click(e[i]),o\u0026\u0026o()},window.fbwd.log=function(e){document.getElementById(\"currentStatus\").innerHTML=e+\"...\"},window.fbwd.scrollToBottom=function(){window.fbwd.scroll\u003cdocument.body.scrollHeight?(console.log(\"scrolling\"),window.fbwd.scroll=document.body.scrollHeight,window.fbwd.scrollAttempts=0,window.scrollTo(0,document.body.scrollHeight)):(console.log(\"not scrolling\"),window.fbwd.scrollAttempts++)},window.fbwd.infiniteScrollToBottom=function(){window.fbwd.scrollAttempts\u003c5?(window.fbwd.scrollToBottom(),setTimeout(window.fbwd.infiniteScrollToBottom,500)):(e(),aPopUp=document.querySelectorAll('div.fbTimelineCapsule a[aria-haspopup=\"true\"][aria-label=\"Story options\"]'),window.fbwd.toDelete=aPopUp.length,window.fbwd.log(\"Will activate \"+aPopUp.length+\" story options popups\"),window.fbwd.clickAll(aPopUp),window.fbwd.log(\"Done\"),document.getElementById(\"activatedPopups\").innerHTML=aPopUp.length,window.fbwd.log(\"Discarding popups\"),window.fbwd.click(document.getElementsByTagName(\"body\")[0]),window.fbwd.log(\"Finding all visible delete handlers\"),window.fbwd.locateDeleteHandlers=function(){aDelete=document.querySelectorAll('a[data-feed-option-name=\"FeedDeleteOption\"]'),aDelete.length===window.fbwd.toDelete?(window.fbwd.toDelete=aDelete,document.getElementById(\"storiesToDelete\").innerHTML=aDelete.length,window.fbwd.log(\"Waiting on you to accept or cancel\")):(window.fbwd.log(\"Searching for stories to delete\"),setTimeout(window.fbwd.locateDeleteHandlers,1e3))},window.fbwd.locateDeleteHandlers(),document.getElementById(\"continueDeletion\").onclick=window.fbwd.continueDeletion)},window.fbwd.continueDeletion=function(){window.fbwd.log(\"Deleting...\"),window.fbwd.delStatus={index:0,clickedDelete:!1,clickedConfirm:!1},window.fbwd.doDelete=function(){if(window.fbwd.delStatus.clickedDelete)if(btn=document.querySelectorAll('div[role=\"dialog\"] button'),window.fbwd.delStatus.clickedConfirm){if(dialog=document.querySelectorAll('div[role=\"dialog\"]'),dialog.length\u003e0)for(i=0;i\u003cdialog.length;i++)dialog[i].parentNode.removeChild(dialog[i]);window.fbwd.delStatus.index\u003cwindow.fbwd.toDelete.length-1?(window.fbwd.delStatus={index:window.fbwd.delStatus.index+1,clickedDelete:!1,clickedConfirm:!1},setTimeout(window.fbwd.doDelete,100)):(window.fbwd.log(\"All done. Will refresh in two seconds\"),setTimeout(function(){location.reload()},2e3))}else btn.length\u003e0\u0026\u0026(window.fbwd.click(btn[0]),window.fbwd.delStatus.clickedConfirm=!0),setTimeout(window.fbwd.doDelete,100);else window.fbwd.click(window.fbwd.toDelete[window.fbwd.delStatus.index]),window.fbwd.delStatus.clickedDelete=!0,setTimeout(window.fbwd.doDelete,100)},window.fbwd.doDelete()},window.fbwd.infiniteScrollToBottom()}();\n    \nThen go to your timeline, and click your bookmark file.\n\nThe process will scroll on your timeline until it cannot find something new, then will get to the top of the page showing you a little box with a button that you need to click to clean your entire wall.\n\nClick it and wait until it has finished. At the end of the process the page will refresh, you should see no more posts on your timeline.\n    \n## The code\n\nThis is the code documented:\n\n```javascript\n(function() {\n  // global holder\n  window.fbwd = {};\n  window.fbwd.scroll = 0;\n  window.fbwd.scrollAttempts = 0;\n\n  // properly send an event to dom element\n  window.fbwd.eventFire = function(el, etype) {\n    if (el.fireEvent) {\n      el.fireEvent('on' + etype);\n    } else {\n      var evObj = document.createEvent('Events');\n      evObj.initEvent(etype, true, false);\n      el.dispatchEvent(evObj);\n    }\n  }\n\n  // click on a dom element\n  window.fbwd.click = function(el) {\n    window.fbwd.eventFire(el, 'click');\n    //console.log('Clicking on ', el);\n  }\n\n  // click on all dom elements part of the array `a`\n  // Run callback cb each time if any given\n  window.fbwd.clickAll = function(a, cb) {\n    for (i = 0; i \u003c a.length; ++i) {\n        window.fbwd.click(a[i]);\n        if (cb) cb();\n    }\n  }\n\n  window.fbwd.log = function(s) {\n    document.getElementById('currentStatus').innerHTML = s + '...';\n  }\n\n  // enhance UI\n  function enhanceUI() {\n    // locate the div.lastCapsule and append a child that will reflect what's being done on the UI\n    // during the delete process.\n    holder = document.createElement('div');\n    holder.id = 'fbwd';\n    // retrieve the first story and copy its generated style\n    firstStory = document.querySelector('div.lastCapsule').nextSibling;\n    holder.className = firstStory.className + \" \" + firstStory.querySelector('div').className;\n    // retrieve the new story post button and copy its generated style\n    newPost = document.querySelector('div.timelineUnitContainer').querySelector('button[type=\"submit\"]');\n    // Ok now that we have our holder div, append some HTML with some predefined ids\n    innerHTML = '\u003cdiv style=\"text-align:center\"\u003e\u003ch2 style=\"color:#3b5998;text-align:center;font-size:2em;margin-bottom:5px;\"\u003eFacebook wall delete\u003c/h2\u003e\u003cbr/\u003e';\n    innerHTML += '\u003cp style=\"font-size:1.25em\"\u003e';\n    innerHTML += '\u003cspan style=\"color: #6a7480; font-weight:bold\"\u003eCurrent status:\u003c/span\u003e ';\n    innerHTML += '\u003cspan style=\"color: #3b5998\" id=\"currentStatus\"\u003eWaiting...\u003c/span\u003e';\n    innerHTML += '\u003c/p\u003e';\n    innerHTML += '\u003cp style=\"font-size:1.25em\"\u003e';\n    innerHTML += '\u003cspan style=\"color: #6a7480; font-weight:bold\"\u003ePopups activated:\u003c/span\u003e ';\n    innerHTML += '\u003cspan style=\"color: #3b5998\" id=\"activatedPopups\"\u003e0\u003c/span\u003e';\n    innerHTML += '\u003c/p\u003e';\n    innerHTML += '\u003cp style=\"font-size:1.25em\"\u003e';\n    innerHTML += '\u003cspan style=\"color: #6a7480; font-weight:bold\"\u003eStories to delete:\u003c/span\u003e ';\n    innerHTML += '\u003cspan style=\"color: #3b5998\" id=\"storiesToDelete\"\u003e0\u003c/span\u003e';\n    innerHTML += '\u003c/p\u003e';\n    innerHTML += '\u003cp\u003e';\n    innerHTML += '\u003cbutton id=\"continueDeletion\" class=\"' + newPost.className + '\"\u003eCLEAN MY WALL !\u003c/button\u003e';\n    innerHTML += '\u003c/p\u003e'\n    innerHTML += '\u003c/div\u003e';\n    holder.innerHTML = innerHTML;\n    document.querySelector('div.lastCapsule').appendChild(holder);\n  }\n\n  window.fbwd.scrollToBottom = function() {\n    if (window.fbwd.scroll \u003c document.body.scrollHeight) {\n      //console.log('scrolling');\n      window.fbwd.scroll = document.body.scrollHeight;\n      window.fbwd.scrollAttempts = 0;\n      window.scrollTo(0, document.body.scrollHeight);\n    } else {\n      //console.log('not scrolling');\n      window.fbwd.scrollAttempts++;\n    }\n  };\n\n  window.fbwd.infiniteScrollToBottom = function() {\n    if (window.fbwd.scrollAttempts \u003c 5) {\n      window.fbwd.scrollToBottom();\n      setTimeout(window.fbwd.infiniteScrollToBottom, 500);\n    } else {\n      // loaded all it could\n      // add some fancy HTML to show progress\n      enhanceUI();\n\n      // force write the popup's content into the DOM\n      // TODO: Make it language independant? Seems not possible at the moment since the aria-label attribute\n      //       is the only thing differentiating from the \"Your friends button\" showing how the story is shared\n      //       among friends. Obviously we cannot rely on generated CSS classes.\n      aPopUp = document.querySelectorAll('div.fbTimelineCapsule a[aria-haspopup=\"true\"][aria-label=\"Story options\"]');\n      window.fbwd.toDelete = aPopUp.length;\n      window.fbwd.log('Will activate ' + aPopUp.length + ' story options popups');\n      window.fbwd.clickAll(aPopUp);\n      window.fbwd.log('Done');\n      document.getElementById('activatedPopups').innerHTML = aPopUp.length;\n      // click somewhere else to discard popups\n      window.fbwd.log('Discarding popups');\n      window.fbwd.click(document.getElementsByTagName('body')[0]);\n\n      window.fbwd.log('Finding all visible delete handlers');\n      window.fbwd.locateDeleteHandlers = function() {\n        aDelete = document.querySelectorAll('a[data-feed-option-name=\"FeedDeleteOption\"]');\n        if (aDelete.length === window.fbwd.toDelete) {\n          // ok cool\n          window.fbwd.toDelete = aDelete;\n          document.getElementById('storiesToDelete').innerHTML = aDelete.length;\n          window.fbwd.log('Waiting on you to accept or cancel');\n        } else {\n          window.fbwd.log('Searching for stories to delete');\n          setTimeout(window.fbwd.locateDeleteHandlers, 1000); // retry\n        }\n      }\n      // locate them!\n      window.fbwd.locateDeleteHandlers();\n\n      document.getElementById('continueDeletion').onclick = window.fbwd.continueDeletion;\n    }\n  };\n\n  // install global function that will be called on user click on generated accept button\n  window.fbwd.continueDeletion = function() {\n    window.fbwd.log('Deleting...');\n    window.fbwd.delStatus = {\n      index: 0,\n      clickedDelete: false,\n      clickedConfirm: false\n    };\n\n    // Method that check for a current story to delete and actually delete it\n    // handling the clicking etc.\n    window.fbwd.doDelete = function() {\n      //console.log('doDelete: ', window.fbwd.delStatus);\n      if (!window.fbwd.delStatus.clickedDelete) {\n        //console.log('Need to click delete button');\n        window.fbwd.click(window.fbwd.toDelete[window.fbwd.delStatus.index]);\n        window.fbwd.delStatus.clickedDelete = true;\n        //console.log('Clicked delete button');\n        setTimeout(window.fbwd.doDelete, 100);\n      } else {\n        btn = document.querySelectorAll('div[role=\"dialog\"] button');\n        if (!window.fbwd.delStatus.clickedConfirm) {\n          //console.log('Waiting for confirm button');\n          if (btn.length \u003e 0) {\n            //console.log('Need to click confirm button');\n            window.fbwd.click(btn[0]);\n            window.fbwd.delStatus.clickedConfirm = true;\n            //console.log('Clicked confirm button');\n          }\n          setTimeout(window.fbwd.doDelete, 100);\n        } else {\n          //console.log('Waiting for dialog to disappear');\n          dialog = document.querySelectorAll('div[role=\"dialog\"]');\n          if (dialog.length \u003e 0) {\n            // discard it really, we don't care\n            // the ajax request is already gone, discard the dialog, we don't care\n            for (i = 0; i \u003c dialog.length; i++)\n              dialog[i].parentNode.removeChild(dialog[i]);\n          }\n          //console.log('Dialog has disappeared');\n          // continue with next timeline story\n          if (window.fbwd.delStatus.index \u003c window.fbwd.toDelete.length - 1) {\n            window.fbwd.delStatus = {\n              index: window.fbwd.delStatus.index + 1,\n              clickedDelete: false,\n              clickedConfirm: false\n            };\n            setTimeout(window.fbwd.doDelete, 100);\n          } else {\n            // We've deleted everything\n            //console.log('All done !');\n            window.fbwd.log('All done. Will refresh in two seconds');\n            setTimeout(function() { location.reload(); }, 2000);\n          }\n        }\n      }\n    };\n\n    // let's do that\n    window.fbwd.doDelete();\n  };\n\n  window.fbwd.infiniteScrollToBottom();\n\n})();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrison%2Fclean-fb-wall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagrison%2Fclean-fb-wall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrison%2Fclean-fb-wall/lists"}