auto-invoice-leeto/node_red_data/flows.json

1 line
12 KiB
JSON
Raw Normal View History

2021-02-28 19:30:15 +01:00
[{"id":"e79fd0e1.60f55","type":"tab","label":"Get last Netflix Invoice and convert it as PDF","disabled":false,"info":""},{"id":"34256184.7e2b8e","type":"tab","label":"Post a invoice on Leeto","disabled":false,"info":""},{"id":"f120e3b1.f67b38","type":"inject","z":"e79fd0e1.60f55","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":40,"wires":[["bf25f228.3c6a5"]]},{"id":"a9e0512d.6cdd7","type":"http request","z":"e79fd0e1.60f55","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://www.netflix.com/BillingActivity","tls":"","persist":false,"proxy":"","authType":"","x":730,"y":100,"wires":[["e03ca39e.a9af28"]],"info":"Get invoice page from Netflix"},{"id":"6d4fb2bd.73cc2c","type":"function","z":"e79fd0e1.60f55","name":"HTTP Headers for Netflix","func":"msg.headers = {};\nmsg.headers['User-Agent'] = 'Mozilla/5.0 (X11; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0';\nmsg.headers['Accept-Language'] = 'fr-FR,fr;q=0.5';\nmsg.headers['Cookie'] = [\n 'SecureNetflixId=' + msg.secureNetflixId,\n 'NetflixId=' + msg.netflixId,\n].join(';');\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":390,"y":100,"wires":[["4c67f40c.bede9c"]]},{"id":"bf25f228.3c6a5","type":"credentials","z":"e79fd0e1.60f55","name":"Netflix Credentials","props":[{"value":"netflixId","type":"msg"},{"value":"secureNetflixId","type":"msg"}],"x":170,"y":100,"wires":[["6d4fb2bd.73cc2c"]]},{"id":"e03ca39e.a9af28","type":"function","z":"e79fd0e1.60f55","name":"Parse Netflix Billing Page","func":"return {\n url: 'https://www.netflix.com' + /\\/invoice\\/print\\/[^\"]*/.exec(msg.payload)\n};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":390,"y":180,"wires":[["bf25f228.3c6a5","8e61a051.3430c8"]]},{"id":"7ddcb19f.58034","type":"http request","z":"e79fd0e1.60f55","name":"","method":"GET","ret":"txt","paytoqs":false,"url":"","persist":false,"authType":"","x":730,"y":180,"wires":[["b03fda42.1373b","690170f6.3fab38","174093e7.8794e4"]]},{"id":"4c67f40c.bede9c","type":"switch","z":"e79fd0e1.60f55","name":"","property":"url","propertyType":"msg","rules":[{"t":"null"},{"t":"nnull"}],"checkall":"false","repair":false,"outputs":2,"x":570,"y":100,"wires":[["a9e0512d.6cdd7"],["7ddcb19f.58034"]]},{"id":"b03fda42.1373b","type":"file","z":"e79fd0e1.60f55","name":"Save last invoice","filename":"/data/lastInvoice.html","appendNewline":false,"createDir":false,"overwriteFile":"true","encoding":"utf8","x":990,"y":180,"wires":[[]]},{"id":"6d08e306.82ab1c","type":"file","z":"e79fd0e1.60f55","name":"Save last invoice as a pdf","filename":"/data/lastInvoice.pdf","appendNewline":false,"createDir":false,"overwriteFile":"true","encoding":"none","x":1030,"y":400,"wires":[[]]},{"id":"5dab3bc3.1f8edc","type":"http request","z":"e79fd0e1.60f55","name":"Api Call for converting to PDF","method":"POST","ret":"bin","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":1030,"y":300,"wires":[["6d08e306.82ab1c","d2bf2b71.93482"]]},{"id":"eb861026.5c287","type":"function","z":"e79fd0e1.60f55","name":"Config for url-to-pdf-api","func":"msg.headers = {};\nmsg.headers['Content-Type'] = 'text/html';\nmsg.headers['X-Api-Key'] = msg.apiToken;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":770,"y":300,"wires":[["5dab3bc3.1f8edc"]]},{"id":"690170f6.3fab38","type":"credentials","z":"e79fd0e1.60f55","name":"url-to-pdf-api Credentials","props":[{"value":"apiToken","type":"msg"},{"value":"url","type":"msg"}],"x":530,"y":300,"wires":[["eb861026.5c287"]]},{"id":"4c6af2dc.2504bc","type":"link out","z":"e79fd0e1.60f55","name":"Last Netflix Invoice as PDF","links":["848ba398.23bef8"],"x":455,"y":580,"wires":[]},{"id":"debc0868.c889a","type":"inject","z":"34256184.7e2b8e","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":120,"wires":[["ac7c6734.52f8f"]]},{"id":"cfd9259a.79e2a8","type":"credentials","z":"34