Menu
Portfolio
Blog
Snippets
Login
Confirm
exit_to_app
Close
Entries
library_add
Utility(Event,Mouse): Log Movement X,Y
delete
Utility(txt): Basic Sentence Generator
delete
Utility(Event,Keyboard): Logger
delete
Utility(txt): Expanded Phrase Generator
delete
Scrape(General|Multi): Paginated Crawler
delete
Scrape(Sunbiz|Multi): Get Biz's By Zip
delete
Utility(Time): Test Load Speed
delete
Scrape(General|Single|NLP): Get Keyword Stats
delete
Scrape(General|Single): Get Text Near Links
delete
Utility(Event|Mouse): Press Down,Up, & Dragend
delete
Utility(Number): Between Range
delete
Utility(Event|Window): On Resize
delete
Scrape(Youtube|Single): Crawl Channel Videos
delete
Scrape(General|Multi): Tiny Link Crawler
delete
Utility(Time): Day of Week Report
delete
Utility(Number): Aspect Ratio Size Pairs
delete
Utility(Data): Sort Object Properties
delete
Scrape(General|Single): RiTa Sentences & Words
delete
Scrape(General|Single): Investigate Element Layers
delete
Scrape(NLP|Single): Using Compromise Plugins
delete
Utility(General): Remote Script Loader
delete
Scrape(General|Single|NLP): Compromise RiTa D3
delete
Scrape(General|Multi|Node): Grouped Node Crawler
delete
Scrape(Amazon|Multi): Crawl Product SERPs
delete
Scrape(Amazon|Multi): Get Paginated Brands
delete
Utility (Data): Download JSON in Browser
delete
Utility (Data): JSON AutoTypes
delete
Scrape(YouTube|Single): Video Page
delete
Utility (Text): Make Page Editable
delete
Utility (Text): Article Editor
delete
Scrape(General|Single|Text): Get Text On Click
delete
Utility (File): DnD File Parser (CSV,JSON,TXT)
delete
Scrape(General|Single): Get Links (Examples)
delete
Scrape(General|Single|Text): Get Sentences by Tag
delete
Utility (File): JSON to CSV via D3.js
delete
Scrape(General|Single): Auto Parse by Content Type
delete
Scrape(General|Single): Get Paragraphs & Sentences
delete
Scrape(Amazon|Multi): Get Reviews by ASIN
delete
Scrape(General|Single): Download Images on Page
delete
Utility(Event,Form): Custom Submit Function
delete
Utility (Fetch): Basic API Post Request
delete
Utility (Event,Form,Fetch): Form Data to API
delete
Utility (Time): Async Delay
delete
Utility (Time): Async Repeat Every N Secs
delete
Scrape(coj): Crawl Property SERPs
delete
Utility (Data): Promise Chain
delete
Utility (Fetch): Examples - JSON,Text,HTML
delete
Scrape(Amazon|Single): Product Review NLP
delete
Utility (Nodejs): Streaming Collections
delete
Scrape(Rate My Professor|Multi): Crawl Prof SERPs
delete
Utility (Time): JS Timer
delete
Utility (Text): Proper Case
delete
Scrape(Thingiverse API): Get Things via Search API
delete
Scrape(General|Single|Node): Get Node Attributes
delete
Scrape(General|Single|Node): Node Attributes + Text
delete
Scrape(Thesaurus): Get Words from SERPs
delete
Scrape(Walmart): Crawl Product SERPs
delete
Scrape(free3d): Crawl 3D Model SERPs
delete
Scrape(Aliexpress|Single): Get Products From SERP
delete
Scrape(simplify3d): Crawl Post SERPs
delete
Scrape(Twitter): Crawl Post Feed (infinite scroll)
delete
Scrape(DDuckGo|Single): Get Links from SERP
delete
Scrape(General|Single): Get Tokens String Distance
delete
Scrape(General|Single): Content Report
delete
Scrape(General|Single|Node): Node Recon (CSV)
delete
Utility (File): D3 JSON to CSV
delete
Scrape(coj|Multi): Crawl Property SERPs
delete
Scrape(coj|Single): sidenote
delete
Scrape(General|Single): Recursive Node Crawler
delete
Utility (Event,Window): Scroll to Root ScrollHeight
delete
Scrape(Indeed|Multi): Crawl Job SERPs
delete
Scrape(Thingiverse API): Get Things By Id
delete
Scrape(Thingiverse): Crawl Things by Category
delete
Scrape(Thingiverse API): Get Thing Batches by Id via DnD
delete
Scrape(YouTube|Single): Get Video Playlist
delete
Utility (Data): Join Thing Metrics & Meta
delete
Utility(Data): Get Nested Array Lengths
delete
Utility (Twitter): Hide Followed Profiles
delete
Utility (Time): YYYY-MM-DD HH:MM:SS
delete
Scrape(Thangs|Multi): Crawl 3D Model SERPs
delete
Scrape(PrusaPrints,Multi): Get Prints
delete
Scrape(Reddit,Single): Get Posts
delete
Userscript(Youtube): Scrape Channel Videos
delete
Userscript(Youtube): Tab Manager
delete
Scrape(Sunbiz|Multi): Biz Details
delete
Utility(Data):DnD View Types
delete
Scrape(General|Single|Node): Select Nodes by Attr
delete
Scrape(Aliexpress|Multi) Get Products via API
delete
Utility(Text): Strip Web Page CSS, Script, Events, Media
delete
Scrape(Youtube|Single) Get Subs
delete
Scrape(General|Single): SelectAll ReduceByProp
delete
Scrape(General|Single): SelectAll ReduceMultiProps
delete
Scrape(General|Multi): Tiny Link Crawler + Delay & Node Reports
delete
Scrape(P5|Multi): Get Examples
delete
Scrape(LinkedIn|Single): Find New Connections
delete
UserScript(linkedIn|Single) Get Jobs
delete
Utility (Time): Date From Days Ago
delete
Utility(General|Single) Keep Scrolling
delete
Scrape(YouTube) Videos From Search
delete
Utility(General|Single): getOffset
delete
Utility(Event,Form): Get Data On Form Input
delete
Utility(Event,Element): ResizeObserver
delete
COCO-SSD Object Categories
delete
Scrape(Wikipedia|Multi): What Links Here?
delete
Scrape(DDuckGo|Single): Download Images
delete
Scrape(General|Single|NLP): Compromise nGram
delete
Save Snippet
View Snippet
var report = []; (async (products) => { const download = (data, fileName) => { var jsonDUMP = JSON.stringify(data); var exportFilename = fileName + ".json"; var csvData = new Blob([jsonDUMP], { type: 'text/csv;charset=utf-8;' }); var link = document.createElement('a'); link.href = window.URL.createObjectURL(csvData); link.setAttribute('download', exportFilename); document.body.appendChild(link); link.click(); document.body.removeChild(link); }; var pages = 1; var processPage = (doc,id) => { var reviews = []; [...doc.querySelectorAll(`div[id*="customer_review"]`)].forEach(review => { try{ var obj = {}; obj.rating = 0; var rating = review.querySelector(`i[data-hook="review-star-rating"]`); var reviewDate = review.querySelector(`[class*="date"]`); if(!+reviewDate){obj.reviewDate = new Date(reviewDate.innerText.split(" on ")[1])} if(rating && rating.innerText && rating.innerText.indexOf("star") > -1){ obj.rating = +rating.innerText.replace(/ out of \d stars/gim,""); } var helpfulVotes = review.querySelector(`span[data-hook="helpful-vote-statement"]`) obj.helpfulVotes = 0; if(helpfulVotes){obj.helpfulVotes = +helpfulVotes.innerText.replace(" people found this helpful","");} if(isNaN(obj.helpfulVotes)){console.log({"skipppingUnhelpful":obj})}else{ obj.review = review.querySelector(".review-text").innerText.replace(/[\n\t\r]+/gim," ").replace(/[\s]+/gim," ").trim() obj.id = id; report.push(obj); } }catch(e){ console.log({e}); } }) return reviews; } var getPage = async (num,id,star) => { var url = `https://www.amazon.com/product-reviews/${id}/?_encoding=UTF8&filterByStar=${star}_star&reviewerType=all_reviews&pageNumber=${num}`; var response = await fetch(url); var text = await response.text(); var parser = await new DOMParser(); var doc = await parser.parseFromString(text, "text/html"); var reviews = await processPage(doc,id); report = [...report, ...reviews]; } var getReviews = async (id,star) => { for await (let num of [1,2]) { await getPage(num, id,star) } } for await (let productID of products){ for await(let star of ["five","four","three","two","one"]){ console.log({productID,star}) await getReviews(productID,star) } } download(report,"printer-reviews-"+asin); })(["B07BR3F9N6", "B08FY851V3", "B08CDS6NPH", "B07FFTHMMN", "B08C2KMV1N", "B083LKPHFH", "B082XDH8NB", "B07JCKNQSZ", "B08CSHPFZN", "B07TH3PDXN", "B07XHK1SW1", "B07TYRGWSQ", "B08BHM9ZGL", "B0882XHFVL", "B07J9QGP7S", "B07VMG98ZN", "B08BL41ZMY", "B088GTBQWD", "B08F7L945C", "B088ZX5VZK", "B07K2ZHMRF", "B07GYRQVYV", "B089F474TJ", "B08FSTRZML", "B07ZQ4VLZT", "B08224LKJS", "B08GKC43QS", "B01HZ4HY9I", "B089JYRFPH", "B08J3ZC726", "B08J713D9Q", "B07WYYBJP5", "B089147P2C", "B07SC5G9TF", "B08545RM52", "B07K3SZBHJ", "B00I8NM6JO", "B089GT1ND1", "B07TVW9HGH", "B07GV5GLLC", "B083QZKD5V", "B07ZR54N5S", "B087NH671G", "B084FBNLHS", "B07ZZ3CG9V", "B07D218NX3", "B08FB326SH", "B087JQL5F7", "B08CSHTKNG", "B089GMWCS8", "B07H9NQWR4", "B083SCXRB8", "B08JGQB9PS", "B07JVB5LH1", "B08CZQPM9G", "B0882VT3KP", "B07FNCFVHN", "B08FFJ87YB", "B01FL49VZE", "B089VJ3F22", "B07WW3RMBW", "B08CRDRHP9", "B07CJQ3D6L", "B07JWJQKN6", "B01HZFWST8", "B07X2PG2YB", "B087N7DT12", "B07JBXVCWG", "B08346QY9K", "B0875XBPRM", "B08GYQ3W6Q", "B08C54YSVW", "B07RT7TW38", "B087CFMLKV", "B08DXJQFC8", "B07TVRJRG5", "B078MWXPL3", "B07RY6NSL8", "B086DMJB1S", "B07GYXP9ZL", "B07CPQQ57D", "B08HYC7ZY7", "B07C3FLY6P", "B07Z62688K", "B087FDTV3X", "B08CDQDSKR", "B08GFML7QQ", "B07JJNX135", "B08GYF1WZB", "B07X3ZWTC7", "B0888DWXMZ", "B08CKW1JMG", "B08G16JN51", "B07Z1PZM2P", "B07TMLJS8Z", "B07SNSQZBD", "B07H92MPRS", "B07DGV2L8Z", "B08BFMYWZP", "B0753GQDNR", "B07HCGTWJK", "B07BB1JSMF", "B08HM82BT6", "B085NGV634", "B0891TQKLX", "B07JVH629F", "B08BLFB9D4", "B07WHGNM7C", "B07QKVCXJQ", "B083SD27XW", "B08CXDZ5WX", "B07ZCVD8KR", "B08HDBS42W", "B08CDRR5KH", "B076FT5RQK", "B083R9JLLX", "B07DYL9B2S", "B08D65ZH5W", "B08HLDM8XK", "B018GZBC3Y", "B01JBEF3T8", "B08HH329TR", "B08GZ3MDFF", "B08394B253", "B083GTS8XJ", "B07GJQHZ3P", "B08GC9ZPR9", "B08F3B9YN4", "B0855M2THS", "B07VYWRK7C", "B08FWY8C9N", "B07Y2TYPG5", "B08868PN2P", "B082VRNLLG", "B086W2FR57", "B088R3FLKN", "B07PRPB25Y", "B07Y2TBFBC", "B08HGKLBYS", "B07KGTF7QS", "B08G89CT3Z", "B07YXYF2XR", "B084X7GWB9", "B08DR3WCV5", "B07XFZYR7L", "B08FZP34S9", "B08DKP4RKW", "B07V9YBVY9", "B086X2989N", "B07TDPLXBN", "B07MK5W8M7", "B07XJKKYB9", "B085KZ1BY9", "B07KT67PPC", "B0899YL9Q9", "B086DK8P6R", "B07QTXHDM3", "B07PMR4HT4", "B07K4957PZ", "B08FSGXK46", "B07GR55L1Y", "B07ZQ14SSF", "B08FR7VVCJ", "B07RSWHWFQ", "B07VHQNWW6", "B083SGMQ85", "B08BYN36HF", "B07NW1WNMK", "B078MJQ1BC", "B07KZ9XHBD", "B07H57YVBG", "B07WVHYWGG", "B07NZ2NJGL", "B07ZLQ7KNK", "B085F19X6M", "B083SNDS9C", "B089GH9WJT", "B082D7WGPK", "B086QK2TFX", "B08JBJM6H6", "B088B4J1H2", "B07ZJ5LRNT", "B08C7PD3MR", "B07XYRYWYB", "B08H7Y1HQY", "B08JPNY7M3", "B087LZ48ZW", "B01N5D2ZIB", "B077PKDC3Q", "B086274P54", "B085T2MSLZ", "B07XF2Y73S", "B08GYJS6QG", "B082XZ7M6S", "B089SVR1GV", "B07PP95WY9", "B08FFZG73H", "B083M2J68Y", "B08626WF87", "B07YDD89V7", "B071KPBH3G", "B075D6L49C", "B089GTNJYQ", "B07Y7H595D", "B07VDDR26C", "B08B3GKML6", "B078V91ST6", "B07ZLZG7XN", "B085DF3NNZ", "B085CFB52J", "B07KCJ29K6", "B07CZD8S8H", "B0872Y8Y6N", "B079LYSQCP", "B08B85YTFG", "B08C4P7Q5D", "B08DTZR755", "B08FT3Y9CL", "B07XRJ9L9T", "B07HKM26XS", "B07WD2SYJX", "B08BLB2VYB", "B08H8LPSN4", "B08DDHK7CK", "B086YWKRDJ", "B089G51291", "B07XP1GR8Z", "B089S19D47", "B07R3YZG4J", "B08CK6F2DN", "B081ZF2HCB", "B07R8ZW7D9", "B0874Y2KNL", "B07YZTBJVV", "B01CL1FCLM", "B07WMPRKG4", "B077T3X3Y3", "B085QF5RW5", "B07GV3JRVC", "B0844YFP7Z", "B085H9HFG1", "B0892JP56B", "B07W4V5BP2", "B0892FX4TJ", "B07KG95NSJ", "B07TQ2NYXY", "B07R4GHKN6", "B07ZYTJFJB", "B088H18W28", "B0899DDT2Q", "B08GYDD2M9", "B08HYMYVKZ", "B07WGJBNFZ", "B07FTMTVWG", "B08FTC8ZD7", "B08BND6PN4", "B08FT6X5ZC", "B08C9KNMQ1", "B01KKP5RZ2", "B088NNX3LP", "B01149KRUI", "B089VLH3VG", "B07Y7GDX7T", "B01CKV7D2E", "B07H99RXQ3", "B079L43XW5", "B07XRJL8BN", "B08B4S3F9Z", "B06XSF5MGT", "B08DHC8HYN", "B086DQB8Y8", "B086M9PVJM", "B07BY7P2DD", "B074KLVL69", "B075JDTYK2", "B089232SV6", "B086991W6X", "B085Q2JD58", "B083TKZ4LM", "B00SVTIX4W", "B086MG6P7Q", "B088ZH199H", "B07ZR4B9YH", "B06XZYJ986", "B07TYFMQW3", "B089SK2BWL", "B085M7MXKN", "B087C51Z7M", "B07PP9ZP8P", "B0874TYTMZ", "B08FTCRG8H", "B084JN9PJH", "B076H552FN", "B00GTWRAD8", "B00MFAFUB2", "B01N374ZFS", "B074QLQSQV", "B086WHYV5G", "B07HRN7K61"])