{"id":17477940,"url":"https://github.com/alejandroesquivel/node-pastebin-scraper","last_synced_at":"2026-02-13T13:46:55.451Z","repository":{"id":91147168,"uuid":"62673027","full_name":"AlejandroEsquivel/Node-Pastebin-Scraper","owner":"AlejandroEsquivel","description":"Minimalistic Pastebin Scraper for Node.js. A way to scrape pastebin's recent paste feed without requiring a LIFETIME PRO account and using their API.  A good tool for those that want to ensure that their accounts have not been compromised during a recent hack.","archived":false,"fork":false,"pushed_at":"2019-02-12T06:17:44.000Z","size":2530,"stargazers_count":15,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-18T23:20:01.043Z","etag":null,"topics":["client","leaks","node-pastebin-scraper","pastebin","scraper","security"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/AlejandroEsquivel.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-05T22:11:32.000Z","updated_at":"2023-08-29T19:53:38.000Z","dependencies_parsed_at":"2023-07-24T00:15:36.134Z","dependency_job_id":null,"html_url":"https://github.com/AlejandroEsquivel/Node-Pastebin-Scraper","commit_stats":{"total_commits":24,"total_committers":4,"mean_commits":6.0,"dds":0.5416666666666667,"last_synced_commit":"7c662fafdb0844638cb7f378fceda9e06bbcb668"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlejandroEsquivel%2FNode-Pastebin-Scraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlejandroEsquivel%2FNode-Pastebin-Scraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlejandroEsquivel%2FNode-Pastebin-Scraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlejandroEsquivel%2FNode-Pastebin-Scraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlejandroEsquivel","download_url":"https://codeload.github.com/AlejandroEsquivel/Node-Pastebin-Scraper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlejandroEsquivel%2FNode-Pastebin-Scraper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259106663,"owners_count":22805940,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["client","leaks","node-pastebin-scraper","pastebin","scraper","security"],"created_at":"2024-10-18T20:10:15.782Z","updated_at":"2026-02-13T13:46:48.402Z","avatar_url":"https://github.com/AlejandroEsquivel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node Pastebin Scraper\n\n# Setup\n\n## Install \nInstall dependencies\n\n```npm i```\n\n## Build\n\nBuild the files, the output will be in the folder `dist`. You can import `dist/index.js` for non ES6 class compatible enviroments.\n\n```npm run build```\n\n## Use example.js\n\nYou need nodemon for this.\n\n```npm i -g nodemon```\n\nRun the example as in example.js\n\n```npm run example```\n\n\n# Usage: Basic \n\nYou can define an array of regex expressions to be matched to each paste's body, the scraper will run through the most recent posted 'pastes' on PasteBin once.\n\n```javascript\nimport PasteBinScraper from './src/index';\n\n//wait 5 seconds before scanning the next paste (default time - recommended).\nconst scraper = new PasteBinScraper({ eachPasteWait: 5000 });\n\n\nconst expressions = [/password/i, / dump /i, /hotmail/i, /gmail/i, /yahoo/i, /hack/i, /leak/i, /db_pass/i, /db_password/i, /href/i, /class/i];\n\nscraper.setExpressionsToMatch(expressions);\n\nscraper.scrape()\n    .then(()=\u003econsole.log('Finished Scraping recent pastes!'))\n    .catch((e)=\u003econsole.error(e));\n\nscraper.on('match',(paste)=\u003e{\n    console.log(`Matched paste! URL (${paste.url} , posted: ${paste.timePosted}`)\n})\n```\n\n# Usage: Poll Recent Pastes Continously\n\n`scraper.Repeat()` exposes (https://www.npmjs.com/package/repeat) a Repeat object, which will scrape PasteBin as per it's configuration.\n\nNote: Repeat is not being maintained anymore, so not recommended for Production use cases.\n\n```javascript\nimport PasteBinScraper from './src/index';\n\nconst scraper = new PasteBinScraper();\n\n\nconst expressions = [/password/i, / dump /i, /hotmail/i, /gmail/i, /yahoo/i, /hack/i, /leak/i, /db_pass/i, /db_password/i, /href/i, /class/i];\n\nscraper.setExpressionsToMatch(expressions);\n\n// under 3 minutes not recommended\nscraper.Repeat().every(3, 'minutes').for(120, 'minutes');\n\nscraper.on('match',(paste)=\u003e{\n    console.log(`Matched paste! URL (${paste.url} , posted: ${paste.timePosted}`)\n})\n```\n\n# API\n\n## constructor(ConfigurationObject)\n\n### ConfigurationObject.eachPasteWait\n\nThe only available configuration at this time is how long to wait before scanning the next paste.\n\n```javascript\nconst scraper = new PasteBinScraper({ eachPasteWait: 5000 });\n```\n\n## scrape()\n\nStarts scraping process, that is, look at Pastebin's recent pastes and iterate through each of them then emit the event `match` when the match condition is met.\n\nReturns a promise that is resolved when the list of recent pastes has been iterated.\n\n```javascript\nscraper.scrape();\n```\n\n## setMatchCondition(Function)\n\nYou can customize what condition should be met when iterating through each paste by supplying a handler, the object 'paste' is passed which contains the attributes: `url`, `postedTime`, `body`\n\nBy default the match condition is just iterates through a set of regex expressions (set by `setExpressionsToMatch`) to ensure at least there is one match, before emitting the 'match' event.\n\n```javascript\n// This example replaces the match condition for all scraping purposes\n\n// If any paste satisfies this condition, 'match' will be emitted.\n\nconst handler = (paste)=\u003e{\n    let { url, postedTime, body } = paste;\n    return body.match(/database/i)\n}\nscraper.setMatchCondition(handler);\n```\n\n## setExpressionsToMatch(Array)\n\nSets an array of Regular Expressions that will need to be matched with a paste's body, assuming `setMatchCondition` has not been called (i.e the default match condition has not been replaced).\n\n```javascript\nscraper.setExpressionsToMatch([/(password|pass)/i,/dralejandro/i]);\n```\n\n## Repeat()\n\nExposes (https://www.npmjs.com/package/repeat) a `Repeat` object, which will scrape PasteBin as per it's configuration.\n\n```javascript\nscraper.Repeat().every(3, 'minutes').for(120, 'minutes');\n```\n\n## on(EventString, Handler)\n\n### EventString: 'match'\n\nThis event is passed a `paste` object which contains the attributes: `url`, `postedTime`, `body`;\n\n```javascript\n scraper.on('match',(paste)=\u003e{\n     //do something\n })\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falejandroesquivel%2Fnode-pastebin-scraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falejandroesquivel%2Fnode-pastebin-scraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falejandroesquivel%2Fnode-pastebin-scraper/lists"}