Jump to content

kc111

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

kc111's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi everyone, I am having trouble with the last() function in xpath . I want to get the text3. The HTML looks like this: div id="body"> <br> <br> text1 <hr> text2 <br> <br> text3 So far I have: $lastdata= $simplexml->xpath("//div[@id='body']/following-sibling::node [last()]"); This is not working. I would appreciate any help. Thank you in advance, Bill
  2. Hi, I am having a similar problem. I am working on win7-64 bit with WAMP 2.1. I am trying to do basically the same thing with the latest Vidalia ( including Tor 0.2.1.30 and Polipo ), running locally. I am using php 5.3 <?php ? //include the class //remember the configuration file is located in: //proxyConfiguration.ini include("./proxyConnector.class.php"); //get an istance of the proxy $connection = proxyConnector::getIstance(); //connect to google.com and change my identity //because "switchIdentityAfterRequest" is set to TRUE //in the .ini file $connection->launch("http://whatismyip.com", null); //get the data and show it $data = $connection->getProxyData(); echo "<pre>"; print_r($data); The class is attached. My problem is that , I would like to switch Identity after each request ( I am querying http://whatismyip.com ) . this happens sometimes, but when I run my script too close together , temporally, the IP address does not switch ( If I wait longer it will ). The following code snippet is running without obvious error when I step through it with xdebug: /** * * Change identity in the Tor Network * (change public IP Address) * * @return bool * true is new identity is created * false is fail creating a new identity */ public function newIdentity(){ $fp = fsockopen($this->ip, $this->controlPort, $errno, $errstr, 30); if (!$fp) return false; //can't connect to the control port fputs($fp, "AUTHENTICATE ".$this->controlPassword."\r\n"); $response = fread($fp, 1024); list($code, $text) = explode(' ', $response, 2); if ($code != '250') return false; //authentication failed //send the request to for new identity fputs($fp, "signal NEWNYM\r\n"); $response = fread($fp, 1024); list($code, $text) = explode(' ', $response, 2); if ($code != '250') return false; //signal failed fclose($fp); return true; } I think that some cacheing may be going on somewhere, or a connection is being maintained when it should not . As a php beginner, I don't know how to test this or where to look. I would appreciate any help. Thank you in advance, KC PS - here is the ini file - I couldn't attach it ; this is the ini file for the proxy configuration ; this default value are for a TOR PROXY running ; on a local machine with HashedControlPassword method ; activated [general] ; timeout timeout = 300 ; proxy ip ip = 127.0.0.1 ; proxy port (default value stands for polipo port) port = 8118 [TOR] ; proxy control port ; be sure to enable control in your ; tor configuration file (/etc/tor/torrc) controlPort = 9051 ; the password setted in the HashedControlPassword ; set a tor control password with: ; tor --hash-password YOUR_STRONG_PASSWORD ; ; To use this default configuration file try: ; tor --hash-password t0rS3cr3tPwD ; ; left blank if you have configured TOR CONTROL PORT ; without a password controlPassword = t0rS3cr3tPwD ; if true after every request the class try to change ; his identity and his userAgent switchIdentityAfterRequest = true [attachment deleted by admin]
  3. Hi , I'm a new programmer . I hope this is the right place for this: I want to access youtube videos via the Zend_gdata_youtube class. I am developing using wampserver 2.01 and netbeans 6.91. <?php $yt = new Zend_Gdata_YouTube(); $query = $yt->newVideoQuery(); $query->category = 'Comedy/dog'; echo $query->queryUrl . "\n"; $videoFeed = $yt->getVideoFeed($query); ?> I was getting the following error: Warning: require(gdata/youtube.php) [function.require]: failed to open stream: No such file or directory in C:\wamp\www\PhpProject1\index.php on line 10 Fatal error: require() [function.require]: Failed opening required 'gdata/youtube.php' (include_path='.;C:\wamp\bin\php\includes;C:\wamp\www\ZendGdata-1.10.8\library') in C:\wamp\www\PhpProject1\index.php on line 10 after changing the php.ini file include line to ; Windows: "\path1;\path2" include_path = ".;C:\wamp\bin\php\includes;C:\wamp\www\ZendGdata-1.10.8\library ( I got this from http://framework.zend.com/manual/en/learning.quickstart.intro.html ) I am getting the following error now: Fatal error: Class 'Zend_Gdata_YouTube' not found in C:\wamp\www\PhpProject1\index.php on line 11 Does this make any sense to anyone? I think this just boils down to getting the right include path, but its not clear to me how to figure this out Thanks in advance, KC
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.