當前位置: 首頁>>代碼示例>>PHP>>正文


PHP phpQuery::plugin方法代碼示例

本文整理匯總了PHP中phpQuery::plugin方法的典型用法代碼示例。如果您正苦於以下問題:PHP phpQuery::plugin方法的具體用法?PHP phpQuery::plugin怎麽用?PHP phpQuery::plugin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在phpQuery的用法示例。


在下文中一共展示了phpQuery::plugin方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: ndfasui8923

<?php

/**
 * Automated google account login.
 * Uses __config.php to keep login data.
 *
 * @package phpQuery.Plugins.Scripts
 * @author Tobiasz Cudnik <tobiasz.cudnik/gmail.com>
 */
phpQuery::ajaxAllowHost('code.google.com', 'google.com', 'www.google.com', 'mail.google.com', 'docs.google.com', 'reader.google.com');
if (!function_exists('ndfasui8923')) {
    function ndfasui8923($browser, $scope)
    {
        extract($scope);
        $browser->WebBrowser()->find('#Email')->val($config['google_login'][0])->end()->find('#Passwd')->val($config['google_login'][1])->parents('form')->submit();
    }
    $ndfasui8923 = new Callback('ndfasui8923', new CallbackParam(), compact('config', 'self', 'return', 'params'));
}
phpQuery::plugin('WebBrowser');
$self->document->xhr = phpQuery::$plugins->browserGet('https://www.google.com/accounts/Login', $ndfasui8923);
//$self->document->xhr = phpQuery::$plugins->browserGet('https://www.google.com/accounts/Login', create_function('$browser', "
//	\$browser
//		->WebBrowser()
//		->find('#Email')
//			->val('{$config['google_login'][0]}')->end()
//		->find('#Passwd')
//			->val('".str_replace("'", "\\'", $config['google_login'][1])."')
//			->parents('form')
//				->submit();"
//));
開發者ID:mnfjorge,項目名稱:moip-php,代碼行數:30,代碼來源:google_login.php

示例2:

<?php

//error_reporting(E_ALL);
require_once '../phpQuery/phpQuery.php';
phpQuery::$debug = true;
phpQuery::plugin('Scripts');
$testName = 'Scripts/example';
$doc = phpQuery::newDocumentFile('test.html');
$testResult = 10;
if ($doc->script('example', 'p')->length == $testResult) {
    print "Test '{$testName}' PASSED :)";
} else {
    print "Test '{$testName}' <strong>FAILED</strong> !!! ";
    print "<pre>";
    var_dump($doc->whois());
    print "</pre>\n";
}
print "\n";
$testName = 'Scripts/gmail_login';
$testResult = 1;
$url = 'http://code.google.com/p/phpquery/w/edit/MultiDocumentSupport';
//phpQuery::ajaxAllowURL($url);
$editor = phpQuery::newDocument('<div/>')->script('google_login')->location($url);
if ($editor->find('textarea#content')->length == $testResult) {
    print "Test '{$testName}' PASSED :)";
} else {
    print "Test '{$testName}' <strong>FAILED</strong> !!! ";
    print "<pre>";
    var_dump($doc->whois());
    print "</pre>\n";
}
開發者ID:atofighi,項目名稱:phpquery,代碼行數:31,代碼來源:test_scripts.php

示例3: plugin

 /**
  * Enter description here...
  *
  * @return phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
  */
 public function plugin($class, $file = null)
 {
     phpQuery::plugin($class, $file);
     return $this;
 }
開發者ID:limi58,項目名稱:fetchJD,代碼行數:10,代碼來源:phpQueryObject.php

示例4: success2

        $pq->WebBrowser('success2')->find('input[name=q]')->val('phpQuery')->parents('form')->submit();
    }
    /**
     *
     * @param $html phpQueryObject
     * @return unknown_type
     */
    function success2($pq)
    {
        print 'success2 callback';
        print $pq->find('script')->remove()->end();
    }
}
// Gmail login (not working...)
if (0) {
    phpQuery::plugin("Scripts");
    phpQuery::newDocument('<div/>')->script('google_login')->location('http://mail.google.com/')->toReference($pq);
    if ($pq) {
        print $pq->script('print_websafe');
    }
}
// Gmail login v2 (not working...)
if (0) {
    $browser = null;
    $browserCallback = new CallbackReference($browser);
    phpQuery::browserGet('http://mail.google.com/', $browserCallback);
    if ($browser) {
        $browser->WebBrowser($browserCallback)->find('#Email')->val('XXX@gmail.com')->end()->find('#Passwd')->val('XXX')->parents('form')->submit();
        if ($browser) {
            print $browser->script('print_websafe');
        }
開發者ID:roma30,項目名稱:monitoring,代碼行數:31,代碼來源:test_webbrowser.php


注:本文中的phpQuery::plugin方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。