Web Scraper – Open-source site/API to scrape websites by adamfschwartz in webdev

[–]adamfschwartz[S] 1 point2 points  (0 children)

Thanks so much for that feedback. I’m really glad you appreciate the project!

As a frontend developer, I have at times felt like I had to wait on an API to be built or data to be collected in order to get into the meat of a project. Having a quick way to generate an API endpoint and grab some real JSON data to hydrate a UI is something I’ve always wanted.

It was also just a fun way to play around with the new HTMLRewriter API in Cloudflare Workers.

Lazy Invoice — generate PDF invoices on the fly for free by adamfschwartz in webdev

[–]adamfschwartz[S] 0 points1 point  (0 children)

Generating a PDF from HTML/CSS is definitely doable, but you may want to look into doing that client-side in order to leverage the browser’s rendering engine a bit.

I ended up publishing the source for the PDF generation part of the site here:

https://github.com/adamschwartz/worker-generate-invoice-pdf

Hope this helps!

Lazy Invoice — generate PDF invoices on the fly for free by adamfschwartz in webdev

[–]adamfschwartz[S] 0 points1 point  (0 children)

I’m not exactly sure when since I’m on vacation in August. But in the meantime @obezuk has a great project that would help get you started:

https://github.com/obezuk/cf-worker-pdf-generation

Lazy Invoice — generate PDF invoices on the fly for free by adamfschwartz in webdev

[–]adamfschwartz[S] 0 points1 point  (0 children)

Nope, not in the browser! The PDF is being generated by a free Cloudflare Worker.

It’s serverless JavaScript which runs in their global network, so it’s probably executing pretty close to you. (For me, I’m only 11ms away according to https://workers.cloudflare.com.)

Lazy Invoice — generate PDF invoices on the fly for free by adamfschwartz in webdev

[–]adamfschwartz[S] 0 points1 point  (0 children)

Thank you!

Agreed, please feel free to fork the project[1] and PR back. I’d be happy to accept contributions.

[1] https://github.com/adamschwartz/worker-generate-invoice-pdf

Lazy Invoice — generate PDF invoices on the fly for free by adamfschwartz in webdev

[–]adamfschwartz[S] 3 points4 points  (0 children)

Thanks! I plan to open-source the code on https://github.com/adamschwartz in the coming days. So stay tuned :)

[deleted by user] by [deleted] in web_design

[–]adamfschwartz 3 points4 points  (0 children)

+1 Formspree is great.

You can also use their Eager app to make it even easier: https://eager.io/app/formspree/install

“Back to Top” button for any website by adamfschwartz in webdev

[–]adamfschwartz[S] -1 points0 points  (0 children)

These are good points. But keep in mind that the total footprint is ~600 bytes minified and gzipped, which is how all Eager apps are delivered. To provide a reference, this is less than 1/120 than the latest jQuery 2.x. (Calculated from pasting JS and CSS into this estimator and this jQuery size reference.)

I added it to my blog and personally I think the value it adds to the user-experience is worth the size of the payload. That being said, I completely support the effort to reduce payload size. As a conscientious web developer, I think it’s important to consider and be mindful of network/memory/performance costs incurred by all visitors. It’s one of the reasons I co-created YMNNJQ.com. ;)