EG Information
Training Missions
Knowledge Bank
Pimp Us Out!
Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site And Create A Link Back To Enigma Group.
|
| |
Affiliates
|
|
Enigma Group's Code Bank
RSS cache scriptBy: Ausome1 - Date Submitted: 2008-09-25 18:59:59 <?php /** * RSS cache script * * Run this script via cron. I run mine every 15 minutes. This will cache rss feeds on your local * machine in /tmp naming the files rss1.cache, rss2.cache and so on. Have your rss reader access * your rss feeds that are locally stored. This will keep you from getting banned to that rss feed * if you're hitting it on every page load and save you and the rss supplier lots of bandwidth. * * This script also uses parallel processing. It will go out and grab the rss feeds all at once. * Lets say you want to gather data from 5 sites and each site takes 5 seconds to scrape. Gathering * each site sequentially would take 25 seconds (5 x 5) for the script to complete. Running the * gathering in parallel allows the script to finish in 5 seconds. The length of the longest scrape. * * @author Ausome1 */ // URLs of content you wish to cache. $urls = array('http://example1.com/rss.xml', 'http://example2.com/rss.xml', 'http://example3.com/rss.xml', 'http://example4.com/rss.xml', 'http://example5.com/rss.xml' ); // No need to alter anything past here. // Create cURL instances, set URL, and other appropriate options. for ($i = 1; $i <= $count; ++$i) { $handle = 'ch' . $i; } // Create the multiple cURL handle. // Add handles for ($i = 1; $i <= $count; ++$i) { $handle = 'ch' . $i; } $running = NULL; { // Retrieve content and write data to cache file. for ($i = 1; $i <= $count; ++$i) { $handle = 'ch' . $i; $data = 'data' . $i; $response_code = 'response_code' . $i; $$response_code = curl_getinfo($$handle, CURLINFO_HTTP_CODE ); if ($$data && $$response_code != '404') { file_put_contents('/tmp/rss' . $i . '.cache', $$data); } } // Close curl session. ?>
|
| Return to
php category list |
|
|
Who Visited EnigmaGroup Today?
1579 Guests, 270 Users (182 Spiders)
GothicLogic, InjectioN, Hessesian, whisperer, limited, whoami, hackaday, Rex_Mundi, trueorfalse, strudels, Bumpadjuppy, DrOptix, Klosse, blackknight911, Effomeidonize, Distorted, JohnMalkovitzch, TheHarrisonW, Obop, hkevin, ellisp, Vreality2007, advenlydent, zach, ddxc, suetekh, Vengeance987, m0rt, 2345, electro-technic, riesenjoe, IvanDimitriev, nmobin27, RomeoG, timetrust, 2142, 3ntr0py, BillTuer, advilapyday, lotato, lonely.connection, CloverCipher, vnd, aurena, rospark, valy1177, Blavatsky, learning, st3alth, Partisan, K0gller, fitz, Jayjay, psychomarine, Vspectrum, San Marino, TinCardinal, brunoriversyhn, code-g, yshiau, Psiber_Syn, Seasharp, obencefoozy, SlayingDragons, Link-, tinuigimeni, jasonbourne, Fred, somebody777, Meonkzt, CJ_Omaha, jearrorne, cls777, unsugsNashy, Balksnuntails, Sir D. Naut, batsbargy, Rik, Macabre, Nightraven, Iccyx, Repuhlsive, vipervince2002, Janomatrix, lol, veceattainc, techno, Exclaw, Nikhil, evjfvir967nj, Mod777, dark_void, nermtode, Tjm, bjy1997, hecky, saraf, elprof, damoniceht, trik, jordan86, SnoopSky, dan_movie, OnetInsolefon, darkfire1515, seojlhmyrhwh, Thoplehap, MaxMeier, 1028rajeev, Abhinav2107, autotuneuser, alexelixir, Tauya, Jozinbrejl, kernel_mod, quolc, anandoump, vladavlada, Taicadine, AnnaNoult, GreenTiger, baripadatimes, Ewing, Blackbeard, thepuppeteer, BON-SELE, hak4r, Unotohumsmush, NIGHTWOLF, m4f10, avacraft, becool, thecoder, n01se, alpha1, saki, ObesseJew, ActictGlync, sajan, unicornrainbow, Domihoolbob, matt.14, max66, SnowFury, Spud101, myfabregas, Ausome1, kajman121, Frudopvia, ideveloper6, OLOLO, Bugshuppy, lamb, VagWirura, LialiTiTviors, Ordeptpen, scifics, Pozycj-Z21, Gkjt, interPuscruse, aaftab, TheCheeseDemon, blackcyxx21, jollyjimbo, N4g4c3N, rineDriekly, Rap70r, Xargos, flarornEral, ovetz13, sonu sahu, Breezy, emitleBen, Hackpad, JWTSR, nicyun, kaizo, itevainee, luke460, AverageJoe, zeratu92, litbk, Mr.Pickle, mannavard1611, LoopyLion, NexusVos, mtroscheck, burberrybagsjr, nikedunksxm, xordux, jeho, Lonewolf034, Dragonite, nhorton, Reloaded, Odile, Kaptain_k1rk, Teefelltugh, grizzly, posthuman01, jakesboy2, pwnpwnlolz, Sabo, Lakhoamnmek, Røgue, dot_Cipher, mori, snickerless1, cart1m, Xendz, KELATALFTUS, hubris, Afrika, welepocourl, carpinteyrofbt, ReottphoffBom, Reahastegah, pumashoesld, pdanielt, dmac006, DnA-Ender, Red Fox, couptupleakb, ryanjcrook, iMaxx, sh3llcod3, TimHortons, EmilaHapsaums, Feld Grau, burgeoningneophyte, Maroonhat, CookieAu, tinkansinar, Mitodina, timberlandoutletlufc, zsefvy, guccioutletox, AlexDiru, AbercrombieFitchhl, Ryuske, r0z4, slchill, kalak55, Ph4Kt480ii, beefarn, Jigoku, WrossyJes, pollolololo, ZepSung, Fragility, jell0, C9019, Othrguy, Noticon, KIKNWING, llasarus, mdubz, leah027, iellswo, MAZI_, Estilaamoli, subtentar, Trollorful, no, nas0151, Traybo, howisthechicken, thethird3y3, Somethingclever, marplusz |
| |
|
|
|
|
|