ryanteck Posted December 4, 2009 Share Posted December 4, 2009 well im stuck a little bit im trying to create a script wich is able to grab a var and use it to get a bit of code from another site eg var=Sojobo-taro submit will then Find In Page habborp.com/home/?name=var find: <img alt="Var" src="http://www.habbo.co.uk/habbo-imaging/avatarimage?figure=hr-802-45.hd-190-1.ch-886-100.lg-285-110.sh-906-110.ea-1404-110.fa-1201-.wa-2009-110&size=b&direction=4&head_direction=4&gesture=sm l" /> Then I Need It TO Copy figure=hr-802-45.hd-190-1.ch-...=4&gesture=sml And Place It In The Code Thanks A Lot Ryanteck Quote Link to comment Share on other sites More sharing options...
Deoctor Posted December 4, 2009 Share Posted December 4, 2009 u can use this code <?php $url_feed='http://google.com'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://validator.w3.org/feed/check.cgi?url=$url_feed"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); $output = curl_exec($ch); $fh = fopen("out.txt", 'w'); fwrite($fh, $output); $value='<img alt="Var" src='; $section = file_get_contents('./out.txt', NULL, NULL, 1256, 95); /*echo $section; $fh1=fopen("out_1.txt",'w'); fwrite($fh1, $section); fclose($fh1); var_dump($section);*/ fclose($fh); curl_close($ch); ?> but after this u need to scan the entire txt file for these characters and display the result.. or else it it comes at a particular place u can use it of directly Quote Link to comment Share on other sites More sharing options...
ryanteck Posted December 4, 2009 Author Share Posted December 4, 2009 so will it automaticly find that text for me? Quote Link to comment Share on other sites More sharing options...
Deoctor Posted December 4, 2009 Share Posted December 4, 2009 what i am basically doing out here is if it is giving the value at the resultant location then it is okay or else it will give false. it will not automatically scan the document(txt file)i am working on that option. Quote Link to comment Share on other sites More sharing options...
ryanteck Posted December 4, 2009 Author Share Posted December 4, 2009 ok then il just wait Quote Link to comment Share on other sites More sharing options...
ryanteck Posted December 4, 2009 Author Share Posted December 4, 2009 the line is always the same so could it work like that? il try using your script Quote Link to comment Share on other sites More sharing options...
Deoctor Posted December 4, 2009 Share Posted December 4, 2009 if the location of the text doesnot change then u can use it with out difficulties.. Quote Link to comment Share on other sites More sharing options...
Deoctor Posted December 4, 2009 Share Posted December 4, 2009 one more thing $section = file_get_contents('./out.txt', NULL, NULL, 1256, 95); change the numbers to the required ones Quote Link to comment Share on other sites More sharing options...
ryanteck Posted December 4, 2009 Author Share Posted December 4, 2009 the line number changes but it is always after the text <div class="profile-setting"> Quote Link to comment Share on other sites More sharing options...
Deoctor Posted December 4, 2009 Share Posted December 4, 2009 then i hope u cannot use the below code Quote Link to comment Share on other sites More sharing options...
ryanteck Posted December 4, 2009 Author Share Posted December 4, 2009 then any help? Quote Link to comment Share on other sites More sharing options...
Deoctor Posted December 4, 2009 Share Posted December 4, 2009 i am working on that will post the code here once i resolve it out Quote Link to comment Share on other sites More sharing options...
ryanteck Posted December 4, 2009 Author Share Posted December 4, 2009 done yet? Quote Link to comment Share on other sites More sharing options...
ryanteck Posted December 4, 2009 Author Share Posted December 4, 2009 Bump NEed Help! Quote Link to comment Share on other sites More sharing options...
ryanteck Posted December 4, 2009 Author Share Posted December 4, 2009 well im stuck a little bit im trying to create a script wich is able to grab a var and use it to get a bit of code from another site eg var=Sojobo-taro submit will then Find In Page habborp.com/home/?name=var find: <img alt="Var" src="http://www.habbo.co.uk/habbo-imaging/avatarimage?figure=hr-802-45.hd-190-1.ch-886-100.lg-285-110.sh-906-110.ea-1404-110.fa-1201-.wa-2009-110&size=b&direction=4&head_direction=4&gesture=sm l" /> Then I Need It TO Copy figure=hr-802-45.hd-190-1.ch-...=4&gesture=sml And Place It In The Code Thanks A Lot Ryanteck Quote Link to comment Share on other sites More sharing options...
ryanteck Posted December 4, 2009 Author Share Posted December 4, 2009 HELP! :wtf: :wtf: :wtf: :wtf: :wtf: :wtf: :wtf: :wtf: :wtf: :wtf: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: Quote Link to comment Share on other sites More sharing options...
ryanteck Posted December 4, 2009 Author Share Posted December 4, 2009 <?php $user = 'Sojobo-Taro'; $html = file_get_contents('http://habborp.com/home/?name='.$user); $doc = new DOMDocument(); @$doc->loadHTML($html); $xpath = new DOMXPath($doc); $results = $xpath->query("//div[@class='profile-figure']/img"); if (!is_null($results)) { foreach ($results as $result) { echo $result->getAttribute('src'); } } ?> will get the link now i need to code it into <?php if(isset($_POST['imager'])) { $name = $_POST['name']; $action = $_POST['action']; $direction = $_POST['direction']; $h_direction = $_POST['h_direction']; $gesture = $_POST['gesture']; $size = $_POST['size']; echo("<p align=\"center\">Your result..</p><p align=\"center\"><img src=\"(Where The Figure Id Goes)" . $name . "&action=" . $action . "&direction=" . $direction . "&head_direction=" . $h_direction . "&gesture=" . $gesture . "&size=" . $size . "\" alt=\"This habbo does not exist\" /></p>"); please help! Quote Link to comment Share on other sites More sharing options...
Deoctor Posted December 7, 2009 Share Posted December 7, 2009 hai i found a resolution for my problem.. hope this might help you out.. <?php $url_feed='http://google.com'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://validator.w3.org/feed/check.cgi?url=$url_feed"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); $output = curl_exec($ch); $fh = fopen("out.txt", 'w'); fwrite($fh, $output); $value1='Congratulations!'; $value='img alt="[Valid RSS]" title="Valid RSS" src="images/valid-rss.png" /> This is a valid RSS feed.'; $file=file_get_contents("out.txt"); //echo $file; $result=stristr($file,$value1); $fh1 = fopen("out1.txt", 'w'); fwrite($fh1,$result); $section = file_get_contents('./out1.txt', NULL, NULL, 39, 95); //echo $section; if($section==$value) { echo "Success"; } else { echo "The test case Failed"; } fclose($fh); fclose($fh1); curl_close($ch); ?> so here actually wht i am doing is that i am cutting the things that would be published above a particular keyword. and storing it in the out1.txt.. this would give the resultant things in which i need to check and i am scan only these for the validation.. Quote Link to comment Share on other sites More sharing options...
plznty Posted December 7, 2009 Share Posted December 7, 2009 You could use preq_match. What are you trying to achieve? I see your doing something using otakus habbo servers. Quote Link to comment Share on other sites More sharing options...
Deoctor Posted December 7, 2009 Share Posted December 7, 2009 dude i got tired of telling the same to everyone.. i used the preg function and the damn thing is not working for me.. so i am using the curl function. i wrote this to find out whether the given url is a valid Rss feed or not.. if u can give me a better solution that would be greatly appreciated.. i have used this function to check that !@$xml=simplexml_load_file("$subscr") after which i have tried the preg..and the funny thing is that preg will not work here as the urls for these feeds will not have common things for different sites Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.