generated from polymech/site-template
latest
This commit is contained in:
parent
8ec21cf2c8
commit
ce59c9a76c
File diff suppressed because one or more lines are too long
@ -927,144 +927,288 @@
|
||||
"isValid": true,
|
||||
"timestamp": 1743177438799
|
||||
},
|
||||
"https://www.youtube.com/watch?v=-igxhoGEQFU": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177622802
|
||||
},
|
||||
"https://www.youtube.com/watch?v=VNiHWN1Oc5M": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177623042
|
||||
},
|
||||
"https://www.youtube.com/watch?v=nsPvmZN3mBo": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177623178
|
||||
},
|
||||
"https://www.youtube.com/watch?v=q8ZyUsKWpD4": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177623344
|
||||
},
|
||||
"https://www.instructables.com/Make-a-YWCA-Pen-From-Recycled-HDPE2-Plastic-Laundr/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177568982
|
||||
},
|
||||
"https://www.instructables.com/HomemadePlastic/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177570023
|
||||
"timestamp": 1743177623718
|
||||
},
|
||||
"https://woodengiftsandmore.shop/about-us/blog/waste-pen/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177570251
|
||||
"timestamp": 1743177623893
|
||||
},
|
||||
"https://www.dayspringpens.com/blogs/the-jotted-line/how-to-recycle-pens": {
|
||||
"https://www.instructables.com/HDPE-Recycled-Pen-and-Pencil-Set/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177570813
|
||||
"timestamp": 1743177625042
|
||||
},
|
||||
"https://ecogreenlove.com/2015/02/19/reusing-pens/": {
|
||||
"https://www.instructables.com/Pen-Blanks-1/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177571476
|
||||
"timestamp": 1743177625597
|
||||
},
|
||||
"https://www.theenvironmentalblog.org/2025/03/bamboo-to-recycled-plastic-materials-green-pens/": {
|
||||
"https://www.johnshenstationery.com/How-to-judge-the-quality-of-recycled-plastic-pens.html": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177572427
|
||||
"timestamp": 1743177626711
|
||||
},
|
||||
"https://www.youtube.com/watch?v=-igxhoGEQFU": {
|
||||
"https://plasticsrecycling.org/apr-design-hub/apr-design-guide/hdpe-rigid-colored/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177572573
|
||||
},
|
||||
"https://www.youtube.com/watch?v=kA-m4qEl85s": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177572747
|
||||
},
|
||||
"https://www.penblanks.ca/everlast-pen-blank-mold-casting-system-bundle": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177574397
|
||||
},
|
||||
"https://www.bgartforms.com/products/copy-of-dogbone-tube-in-casting-system-bg061": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177574948
|
||||
"timestamp": 1743177627322
|
||||
},
|
||||
"https://www.materialise.com/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177626631
|
||||
"timestamp": 1743177627514
|
||||
},
|
||||
"https://www.youtube.com/watch?time_continue=163\\&v=95aPYlXShTY\\&feature=emb_logo": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177626792
|
||||
"timestamp": 1743177627592
|
||||
},
|
||||
"https://gudmould.wordpress.com/2022/01/23/structural-optimization-design-of-injection-mould-for-automobile-inner-door-handle/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177691816
|
||||
"timestamp": 1743177761457
|
||||
},
|
||||
"https://www.mastercam.com/news/blog/everything-you-need-to-know-about-cnncmachining-for-injection-mold-making/": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743177692740
|
||||
},
|
||||
"https://xometry.pro/en-tr/articles/injection-moulding-overview/": {
|
||||
"https://collections.vam.ac.uk/item/O1609498/3d-printed-door-materialise/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177694368
|
||||
"timestamp": 1743177761775
|
||||
},
|
||||
"https://www.beaumontinc.com/about/books-by-beaumont/": {
|
||||
"https://www.mcmusa.net/thermoset-injection-molded-oven-handle-appliance-industry/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177695557
|
||||
"timestamp": 1743177762734
|
||||
},
|
||||
"https://www.espublisher.com/uploads/article_pdf/esmm5f713.pdf": {
|
||||
"https://www.cmz.com/en/production-of-door-knobs-and-handles/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177696057
|
||||
"timestamp": 1743177764089
|
||||
},
|
||||
"https://formlabs.com/blog/diy-injection-molding/": {
|
||||
"https://gudmould.wordpress.com/2021/04/12/design-of-injection-mold-for-combination-molding-of-refrigerator-door-handle/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177696484
|
||||
"timestamp": 1743177764483
|
||||
},
|
||||
"https://www.youtube.com/watch?v=bzMf9PCwqVE": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177764662
|
||||
},
|
||||
"https://www.instructables.com/My-Metal-Hand-Doorknob/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177766171
|
||||
},
|
||||
"https://www.instructables.com/Hands-free-Door-Unlatching/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177766636
|
||||
},
|
||||
"https://www.mockett.com/ada-hardware/dhc1-90.html": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177767419
|
||||
},
|
||||
"https://upmold.com/Product/kitchenware-handle-part/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177768119
|
||||
},
|
||||
"https://www.dremel.com": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177748755
|
||||
"timestamp": 1743177768367
|
||||
},
|
||||
"https://www.instructables.com/Surfboard-Single-Fin/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177848949
|
||||
},
|
||||
"https://forum.swyaurMatlock.locks.com/t/molding-fins-topic/41310": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743177849404
|
||||
},
|
||||
"https://www.youtube.com/watch?v=qkVutYonQhM": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177803774
|
||||
"timestamp": 1743177849587
|
||||
},
|
||||
"https://cad-journal.net/files/vol_18/CAD_18\\(2\\": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743177804363
|
||||
},
|
||||
"https://libjournals.unca.edu/ncur/wp-content/uploads/2021/01/3352-Garzon-Pat-FINAL-1.pdf": {
|
||||
"https://www.youtube.com/watch?v=u3uol95L0H8": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177805011
|
||||
"timestamp": 1743177849763
|
||||
},
|
||||
"https://davehakkens.nl/community/forums/topic/surfboard-fins-by-injection/index.html": {
|
||||
"https://www.youtube.com/watch?v=6hPlnHdLes4": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177805233
|
||||
"timestamp": 1743177849946
|
||||
},
|
||||
"https://www.matterhackers.com/articles/design-lab-3d-printing-surfboard-fins": {
|
||||
"https://forum.swaylocks.com/t/boardcad-open-source-cad-program-for-surfboards/24788": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177805709
|
||||
"timestamp": 1743177850620
|
||||
},
|
||||
"https://kanoa-surfboards.com/products/beginners-surf-companion-guide-book": {
|
||||
"https://forum.swaylocks.com/t/molding-fins-topic/41310": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177807081
|
||||
"timestamp": 1743177850890
|
||||
},
|
||||
"https://www.plastic.org.au/products/mould-surfboard-fin": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743177851259
|
||||
},
|
||||
"#": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743178003018
|
||||
"timestamp": 1743177963957
|
||||
},
|
||||
"https://baiwemolding.com/acrylic-injection-molding-process/": {
|
||||
"https://www.addcomposites.com/post/fundamentals-of-plasticizing-screw-extrusion-from-injection-molding-to-3d-printing": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178213788
|
||||
"timestamp": 1743178130899
|
||||
},
|
||||
"https://autoprotoway.com/acrylic-injection-molding/": {
|
||||
"https://www.worksafe.govt.nz/topic-and-industry/machinery/working-safely-with-plastic-production-machinery/plastics-extrusion-presses/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178214442
|
||||
"timestamp": 1743178133548
|
||||
},
|
||||
"https://pd3.4spe.org/plastic-part-design-for-economical-injection-molding-part-iii/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178215099
|
||||
"https://www.plasticstoday.com/extrusion-pipe-profile/extrusion-basics-safe-at-home-and-at-work": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743178133713
|
||||
},
|
||||
"https://prototool.com/acrylic-injection-molding/": {
|
||||
"https://www.la-plastic.com/post/what-safety-measures-are-needed-in-injection-molding": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178215898
|
||||
"timestamp": 1743178138504
|
||||
},
|
||||
"https://prototool.com/polypropylene-injection-molding/": {
|
||||
"https://www.ptonline.com/articles/spi-revises-extrusion-injection-molding-automation-safety-standards": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178216584
|
||||
"timestamp": 1743178139389
|
||||
},
|
||||
"https://xcmachining.com/acrylic-injection-molding/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178217227
|
||||
"https://www.geocities.ws/dfloyd2292/hazards.html": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743178139490
|
||||
},
|
||||
"https://patents.google.com/patent/US2586978A/en": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178218188
|
||||
"https://crescent.education/wp-content/uploads/2019/02/MODULE-II-%E2%80%93-FUNDAMENTALS-OF-EXTRUSION-MOULDING.pdf": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743178140577
|
||||
},
|
||||
"https://patents.google.com/patent/CN103660127A/en": {
|
||||
"https://rjginc.com/essential-injection-molding-safety-standards-and-practices/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178218937
|
||||
"timestamp": 1743178142238
|
||||
},
|
||||
"https://www.xometry.com/capabilities/injection-molding-service/acrylic-molding/": {
|
||||
"https://pmc.ncbi.nlm.nih.gov/articles/PMC10348544/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178219722
|
||||
"timestamp": 1743178142446
|
||||
},
|
||||
"https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0288696": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743178142673
|
||||
},
|
||||
"https://www.jove.com/v/59834/design-an-open-source-low-cost-bioink-food-melt-extrusion-3d": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178143155
|
||||
},
|
||||
"https://www.oldergeeks.com/downloads/search.php?limit=100\\&string=Power+Software+Ltd.\\&sort=file_name\\&order=asc\\&id=0\\&page=9": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178143759
|
||||
},
|
||||
"https://3dprint.com/261996/ystruder-new-syringe-system-offers-feature-rich-open-source-multifunction-extrusion/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178144092
|
||||
},
|
||||
"https://www.protolabs.com/resources/design-tips/injection-molding-design-guide/": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743178189244
|
||||
},
|
||||
"https://www.matweb.com/search/datasheet.aspx?matguid=9a1821ef3b874c14b7e69dafd168c5f0": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178190381
|
||||
},
|
||||
"https://www.springer.com/gp/book/9781461359299": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743178190616
|
||||
},
|
||||
"https://www.sciencedirect.com/science/article/pii/S2351978919305941": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743178190871
|
||||
},
|
||||
"https://www.youtube.com/watch?v=JM0kK9m2Cis": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178191047
|
||||
},
|
||||
"https://www.youtube.com/watch?v=5X8ZxOZ9VUg": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178191207
|
||||
},
|
||||
"https://www.grabcad.com/library/injection-mold-design-templates": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743178191884
|
||||
},
|
||||
"https://www.thingiverse.com/thing:5432102": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743178192158
|
||||
},
|
||||
"https://www.gestiondecompras.com/en/products/sheet-metal/sheet-metal-bending/": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178703236
|
||||
},
|
||||
"https://www.beeplastic.com/blogs/plastic-insights/a-beginner-s-guide-to-bending-abs-plastic-sheets-and-rods": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178703385
|
||||
},
|
||||
"https://www.notesandsketches.co.uk/PDF/Line_Bending_Process.pdf": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178703808
|
||||
},
|
||||
"https://www.junklabz.com/sheet-press": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178704043
|
||||
},
|
||||
"https://www.huaaoplastics.com/resources/the-ultimate-guide-to-the-precious-plastic-sheetpress.html": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178704718
|
||||
},
|
||||
"https://madsg.com/wp-content/uploads/2015/12/Designing_the_Internet_of_Things.pdf": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178705659
|
||||
},
|
||||
"https://www.worldscientific.com/doi/10.1142/9789812797070_0001": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743178705745
|
||||
},
|
||||
"https://www.youtube.com/watch?v=IPEsbg7AmVE": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178705879
|
||||
},
|
||||
"https://en.wikipedia.org/wiki/Fretsaw": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178706025
|
||||
},
|
||||
"https://en.wikipedia.org/wiki/Jigsaw_\\(power_tool\\": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743178706098
|
||||
},
|
||||
"https://www.amazon.de/-/en/Stanley-10-099-Classic/dp/B001FWP58U": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743178706289
|
||||
},
|
||||
"https://www.amazon.de/-/en/Wilton-2304-2104-1040-Decorating-Christmas/dp/B0096SI0XW": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743178706464
|
||||
},
|
||||
"https://www.amazon.de/-/en/Stanley-0-83-277-Hand-Drill/dp/B0001IWU0E": {
|
||||
"isValid": true,
|
||||
"timestamp": 1743178706752
|
||||
},
|
||||
"https://www.amazon.de/-/en/Tefal-Sandwich-Gourmet-Grill-Omelette/dp/B07CHLFM6H": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743178706995
|
||||
},
|
||||
"https://www.amazon.de/-/en/Sistema-To-Go-Microwave-Containers-3-5liter-BPA/dp/B07PK4VDRH": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743178707193
|
||||
},
|
||||
"https://www.amazon.de/-/en/dp/B00B1JGJJ0": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743178707424
|
||||
},
|
||||
"https://www.amazon.de/-/en/Uvex-Protection-Super-Fog-Resistant-Transparent/dp/B003A7QCTK": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743178707670
|
||||
},
|
||||
"https://www.amazon.de/-/en/3M-8812-Particulate-Respirator-10-Pack/dp/B07FYV4CQ7": {
|
||||
"isValid": false,
|
||||
"timestamp": 1743178707788
|
||||
}
|
||||
}
|
||||
@ -3,7 +3,7 @@
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Return a list of references (only with links), as Markdown, grouped : Articles, Books, Papers, Youtube, Opensource Designs, ... Dont comment !\n\nText to process:\nFrequently, individuals inquire about achieving attractive patterns in beams, and interestingly, no special technical tricks are involved. The method aligns with standard practices, using a basic steel pipe mold and relying on the extruder's function. Here's how you can achieve similar results.\n\nIn order to create patterns with distinct layers, use at least two colors. It makes no difference whether you work with PP (Polypropylene) or PE (Polyethylene), as there are no noticeable differences between the two in this context. Keep color mixes separate. The dark blue used here was mixed with transparent flakes, which serve as an effective filler. This allows you to use less dark blue pigment without compromising the output, as the pigments are usually strong. For example, adding 2.2 lbs (1 kg) of transparent flakes to 2.2 lbs (1 kg) of dark blue yields 4.4 lbs (2 kg) of dark blue material while maintaining color quality. The white used here is pure white.\n\n### Extrusion Process Guide\n\n1. **Initial Setup**: Add a few scoops into the extruder.\n2. **Operation**: Activate the machine and ensure the material is thoroughly melted.\n3. **Mold Installation**: Attach the cold mold and restart the machine.\n4. **Material Addition**:\n - For the first color, use approximately 3 scoops total, accounting for any material already in the hopper.\n - As the hopper nears empty, add 2 scoops of the second color.\n - Adjust quantities as needed until the mold is filled.\n5. **Cooling**: Remove the mold to let it cool. While some suggest water cooling to avoid leakage, it is typically unnecessary.\n\n## Analysis of the Mixing Process\n\nUpon sectioning the beam, observe the evolving pattern. Initially, the first color adheres to the mold's surface and begins to cool. Meanwhile, the inner core remains fluid, allowing subsequent colors to pass through. Repeatedly altering the input colors results in multiple layers within the beam. Proceed to the next step for further theoretical insights.\n\nAnother essential theory suggests that as plastic moves further into the mold, it cools, necessitating increased pressure for continued flow. The further from the inlet, the patterns become intricate due to variations in temperature and pressure. This phenomenon is particularly notable in square tubes, where flow slows at the corners. In contrast, round tubes likely produce circular patterns.\n\nRefer to the video for the process of creating a chessboard with these beams. Thank you for reading, and enjoy your pattern-making!"
|
||||
"content": "Return a list of references (only with links), as Markdown, grouped : Articles, Books, Papers, Youtube, Opensource Designs, ... Dont comment !\n\nText to process:\nTransform plastic waste into charming Christmas ornaments for decoration or gift embellishment.\n\n**Required Materials:**\n\n- Bottle caps\n- Panini press with a flat surface\n- Silicone gloves\n- Baking paper\n- Eye protection\n- Respiratory mask\n- Fret saw (manual or electrical)\n- Sharp knife or razor blade\n- Cookie cutters or paper stencil\n\n\nUser Location: Luneburg, Germany\n\n### Bottle Cap Sorting Guide\n\n1. **Identify Plastic Type** \n Sort bottle caps by type: either HDPE or PP. Check for the recycling symbol inside the cap: '2' indicates HDPE and '5' indicates PP.\n\n2. **Physical Identification** \n If not labeled, determine plastic type by feel. HDPE caps are more flexible, PP caps are rigid. Typically, milk jug caps are HDPE; soda bottle caps may be PP. \n\n3. **Contamination Precaution** \n When uncertain about a cap's type, discard it to prevent possible contamination of the batch.\n\n### Cleaning and Preparing Caps\n\n1. **Wash Caps**: Soak caps in a sink and scrub with a brush, or for larger quantities, place them in a laundry bag and use a short cycle in the washing machine. Ensure the caps are thoroughly dried before proceeding.\n\n2. **Color Selection**: Decide on color combinations for your ornaments. While the example uses red, white, and green, choose based on your available colors and desired aesthetic.\n\nPlug in your panini press and let it heat up. Use a flat surface model for an even plastic sheet. Once hot, place a baking sheet on the press. Teflon sheets are recommended for durability.\n\nPlace bottle caps on the press; orientation doesn't matter. Cover them with a second baking sheet and close the press.\n\nTo aid the melting process, place a heavy object, such as bricks or books, on top of the press.\n\nAfter melting the bottle caps, you can add additional layers as in Step 2. The desired thickness of your ornaments will determine the number of layers. For a plastic sheet approximately 0.12 to 0.16 inches (3 to 4 mm) thick, melt 2 to 4 layers of bottle caps, depending on their size.\n\nYou should now have a layer of melted bottle caps. You may use the sheet immediately or create a batik design. To do so, wear silicone gloves, roll the warm plastic into a sausage shape, and twist it. Let your creativity guide you—pull, fold, and twist the plastic until the desired pattern is achieved. If the plastic hardens, simply reheat it in the press to make it moldable again.\n\nAt this point, you have a lump of plastic that needs to be melted again to form a flat sheet.\n\nPlace the plastic piece inside the panini press and heat it until it softens. Once pliable, apply pressure to the press. To enhance stretching, consider gently sitting on the press, ensuring you avoid burns. \n\nAlternatively, use a rolling pin after removing the plastic, though maintaining contact with the heat source typically yields better results.\n\nOpen the press periodically to check if the sheet has reached the desired thickness. Once satisfied, turn off the press and allow the sheet to cool with a weight on top to prevent deformation.\n\nOnce the sheet has cooled, you can begin designing. Use a pen suitable for plastic to sketch your ornaments. Cookie cutters or paper stencils can serve as helpful guides.\n\nConsider the sawing process when selecting a design; intricate patterns are harder to cut. Starting with simple designs and gradually moving to complex ones is advisable.\n\n## Cutting Instructions\n\nFor this step, use a fretsaw, which can be manual or electric. An electric saw simplifies the process, but a manual saw is also effective with some additional patience.\n\nGuide the saw along the lines drawn on the plastic sheet to complete your Christmas ornament.\n\nTo clean the edges of your ornament, use a sharp knife or razor blade, as it is more effective than sandpaper. Ensure all small plastic pieces are collected during this process for reuse. They can be melted down again in future projects.\n\nTo complete your ornament, drill a small hole at the top to accommodate your string, considering its thickness. \n\nWe used strings collected over the years. \n\nYour ornaments are now ready. Congratulations on your effort to reduce waste during Christmas.\n\n### Handmade Holiday Ornaments\n\nThis step is optional. By gifting your handmade ornaments to friends or family, you demonstrate that new items are not necessary for Christmas decorations. Creating ornaments from bottle caps utilizes materials that might otherwise be discarded. This approach results in unique, handmade decorations. \n\nMerry Christmas,\nMaria & Nike from IN MOCEAN"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { describe, it, expect, jest } from '@jest/globals';
|
||||
import { PuppeteerUrlChecker, FetchUrlChecker, checkUrl, UrlCheckResult } from './url.js';
|
||||
import { describe, it, expect, jest, afterAll } from '@jest/globals';
|
||||
import { PuppeteerUrlChecker, FetchUrlChecker, checkUrl, UrlCheckResult, clean } from './url.js';
|
||||
|
||||
describe('URL Checker', () => {
|
||||
// Test URLs
|
||||
@ -10,6 +10,11 @@ describe('URL Checker', () => {
|
||||
// Increase timeout for real browser tests
|
||||
jest.setTimeout(30000);
|
||||
|
||||
// Clean up after all tests
|
||||
afterAll(async () => {
|
||||
await clean();
|
||||
});
|
||||
|
||||
describe('PuppeteerUrlChecker', () => {
|
||||
const checker = new PuppeteerUrlChecker();
|
||||
|
||||
@ -27,7 +32,7 @@ describe('URL Checker', () => {
|
||||
it('should handle timeouts', async () => {
|
||||
const result = await checker.check('http://example.com:81', 1000); // Port 81 should timeout quickly
|
||||
expect(result.valid).toBe(false);
|
||||
expect(result.error).toContain('Timeout');
|
||||
expect(result.error).toContain('Navigation timeout');
|
||||
});
|
||||
|
||||
it('should handle network errors', async () => {
|
||||
@ -39,9 +44,16 @@ describe('URL Checker', () => {
|
||||
|
||||
describe('FetchUrlChecker', () => {
|
||||
const checker = new FetchUrlChecker();
|
||||
let mockFetch: jest.Mock;
|
||||
|
||||
beforeEach(() => {
|
||||
global.fetch = jest.fn() as unknown as typeof fetch;
|
||||
mockFetch = jest.fn();
|
||||
global.fetch = mockFetch as unknown as typeof fetch;
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
// Restore the original fetch
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('should validate a valid URL', async () => {
|
||||
@ -51,7 +63,7 @@ describe('URL Checker', () => {
|
||||
statusText: 'OK'
|
||||
} as unknown as Response;
|
||||
|
||||
(global.fetch as unknown as jest.Mock).mockResolvedValue(mockResponse);
|
||||
mockFetch.mockResolvedValue(mockResponse);
|
||||
|
||||
const result = await checker.check(validUrl);
|
||||
expect(result).toEqual({ valid: true });
|
||||
@ -64,7 +76,7 @@ describe('URL Checker', () => {
|
||||
statusText: 'Not Found'
|
||||
} as unknown as Response;
|
||||
|
||||
(global.fetch as unknown as jest.Mock).mockResolvedValue(mockResponse);
|
||||
mockFetch.mockResolvedValue(mockResponse);
|
||||
|
||||
const result = await checker.check(invalidUrl);
|
||||
expect(result).toEqual({
|
||||
@ -74,7 +86,7 @@ describe('URL Checker', () => {
|
||||
});
|
||||
|
||||
it('should handle timeouts', async () => {
|
||||
(global.fetch as unknown as jest.Mock).mockRejectedValue(new Error('Timeout'));
|
||||
mockFetch.mockRejectedValue(new Error('Timeout'));
|
||||
|
||||
const result = await checker.check(timeoutUrl);
|
||||
expect(result).toEqual({
|
||||
|
||||
@ -1,5 +1,46 @@
|
||||
import puppeteer from 'puppeteer';
|
||||
|
||||
// Global browser instance cache
|
||||
let globalBrowser: puppeteer.Browser | null = null;
|
||||
let browserInitPromise: Promise<puppeteer.Browser> | null = null;
|
||||
|
||||
async function getGlobalBrowser(): Promise<puppeteer.Browser> {
|
||||
if (globalBrowser) {
|
||||
return globalBrowser;
|
||||
}
|
||||
|
||||
if (browserInitPromise) {
|
||||
return browserInitPromise;
|
||||
}
|
||||
|
||||
browserInitPromise = puppeteer.launch({
|
||||
headless: 'new' as any,
|
||||
args: ['--ignore-certificate-errors', '--no-sandbox', '--disable-setuid-sandbox']
|
||||
});
|
||||
|
||||
try {
|
||||
globalBrowser = await browserInitPromise;
|
||||
browserInitPromise = null;
|
||||
return globalBrowser;
|
||||
} catch (error) {
|
||||
browserInitPromise = null;
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the global browser instance and cleans up resources.
|
||||
* This should be called when shutting down the application or when
|
||||
* you need to explicitly release browser resources.
|
||||
*/
|
||||
export async function clean(): Promise<void> {
|
||||
if (globalBrowser) {
|
||||
await globalBrowser.close();
|
||||
globalBrowser = null;
|
||||
}
|
||||
browserInitPromise = null;
|
||||
}
|
||||
|
||||
export interface UrlCheckResult {
|
||||
valid: boolean;
|
||||
error?: string;
|
||||
@ -14,13 +55,8 @@ export class PuppeteerUrlChecker implements UrlChecker {
|
||||
private readonly userAgent: string = 'Mozilla/5.0 (compatible; PolymechBot/1.0; +http://polymech.org)';
|
||||
|
||||
async check(url: string, timeout: number = this.defaultTimeout): Promise<UrlCheckResult> {
|
||||
let browser;
|
||||
try {
|
||||
browser = await puppeteer.launch({
|
||||
headless: 'new' as any,
|
||||
args: ['--ignore-certificate-errors', '--no-sandbox', '--disable-setuid-sandbox']
|
||||
});
|
||||
|
||||
const browser = await getGlobalBrowser();
|
||||
const page = await browser.newPage();
|
||||
await page.setUserAgent(this.userAgent);
|
||||
await page.setDefaultNavigationTimeout(timeout);
|
||||
@ -30,6 +66,8 @@ export class PuppeteerUrlChecker implements UrlChecker {
|
||||
timeout: timeout
|
||||
});
|
||||
|
||||
await page.close();
|
||||
|
||||
if (!response) {
|
||||
return { valid: false, error: 'No response received' };
|
||||
}
|
||||
@ -55,12 +93,12 @@ export class PuppeteerUrlChecker implements UrlChecker {
|
||||
valid: false,
|
||||
error: 'Unknown error occurred'
|
||||
};
|
||||
} finally {
|
||||
if (browser) {
|
||||
await browser.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async close(): Promise<void> {
|
||||
await clean();
|
||||
}
|
||||
}
|
||||
|
||||
export class FetchUrlChecker implements UrlChecker {
|
||||
|
||||
@ -3,16 +3,8 @@ process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0';
|
||||
export * from './howto-model.js'
|
||||
import { HOWTO_ROOT } from "config/config.js";
|
||||
import { filterMarkdownLinks } from "../base/markdown.js";
|
||||
import { check } from 'linkinator';
|
||||
import { linkCache } from './link-cache.js';
|
||||
|
||||
import https from 'node:https';
|
||||
|
||||
const httpsAgent = new https.Agent({
|
||||
// Disables TLS/SSL certificate verification
|
||||
rejectUnauthorized: false
|
||||
});
|
||||
|
||||
interface Item {
|
||||
data: {
|
||||
slug: string;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user