本文整理汇总了PHP中getHTML函数的典型用法代码示例。如果您正苦于以下问题:PHP getHTML函数的具体用法?PHP getHTML怎么用?PHP getHTML使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getHTML函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: parseGG
function parseGG($name)
{
$url = "http://www.gamersgate.com/DD-" . $name . "/";
$html = getHTML($url);
preg_match("/price_price(.*)>([0-9]+)/", $html, $match);
$price = $match[2];
return $price;
}
开发者ID:GrigoriyMikhalkin,项目名称:gbd,代码行数:8,代码来源:parseGG.php
示例2: parseGMG
function parseGMG($name)
{
$url = "http://www.greenmangaming.com/s/ru/en/pc/games/" . $name . "/";
$html = getHTML($url);
preg_match("/\"product_price_readable\": \"[0-9]+?(\\.[0-9]+)\"/", $html, $match);
$price = $match[0];
return explode(":", $price)[1];
}
开发者ID:GrigoriyMikhalkin,项目名称:gbd,代码行数:8,代码来源:parseGMG.php
示例3: parseSteam
function parseSteam($gameid)
{
$url = "http://store.steampowered.com/app/" . $gameid . "/";
$html = getHTML($url);
preg_match("/itemprop=\"price\".*\"([0-9]+?,?[0-9]+)\"/", $html, $match);
$price = $match[1];
return array($price, $url, "Steam");
}
开发者ID:GrigoriyMikhalkin,项目名称:gbd,代码行数:8,代码来源:parseSteam.php
示例4: fileupload_process
function fileupload_process($file)
{
$attachment = handle_file($file);
if (is_array($attachment)) {
$html = getHTML($attachment);
$response = array('success' => true, 'html' => $html, 'attach' => $attachment['id']);
echo json_encode($response);
exit;
}
$response = array('success' => false);
echo json_encode($response);
exit;
}
开发者ID:riddya85,项目名称:rentail_upwrk,代码行数:13,代码来源:ajax_upload.php
示例5: displayCFRow
public static function displayCFRow($row_key, $keyspace_name, $columnfamily_name, $row, $scf_key = null, $is_counter_column = false)
{
$vw_vars['scf_key'] = $scf_key;
$vw_vars['row'] = $row;
$vw_vars['keyspace_name'] = $keyspace_name;
$vw_vars['columnfamily_name'] = $columnfamily_name;
$vw_vars['row_key'] = $row_key;
// If it's a column family of counter
if ($is_counter_column) {
return getHTML('columnfamily_row_counter.php', $vw_vars);
} else {
return getHTML('columnfamily_row.php', $vw_vars);
}
}
开发者ID:nyo16,项目名称:Cassandra-Cluster-Admin,代码行数:14,代码来源:ColumnFamilyHelper.php
示例6: parseGOG
function parseGOG($name)
{
$gameName = prepareNameGOG($name);
$url = "http://www.gog.com/game/" . $gameName;
$html = getHTML($url);
preg_match("/buy-price__new(.*)>([0-9]+)/", $html, $match_disc);
preg_match("/class=\"buy-price(.*)>([0-9]+)/", $html, $match);
if (count($match_disc[0]) != 0) {
$price = $match[2] < $match_disc[2] ? $match[2] : $match_disc[2];
} else {
$price = $match[2];
}
return array($price, $url, "GOG");
}
开发者ID:GrigoriyMikhalkin,项目名称:gbd,代码行数:14,代码来源:parseGOG.php
示例7: loader
/**
* @brief Charge les fichiers Javascript selon le nom de la page et selon l'état de l'application (production ou développement)
* @param String $controlName Nom de la page qui demande à inclure le Javascript
* @return String Code HTML nécessaire à l'inclusion du/des codes Javascript
* @see JSLoader::$production
*/
public static function loader($controlName)
{
$result = "";
if (self::$production == false) {
$file = array();
if (file_exists(self::$base . "common.js")) {
$file[] = self::$base . 'common.js';
}
if (file_exists(self::$base . $controlName . ".js")) {
$file[] = self::$base . $controlName . ".js";
}
foreach ($file as $f) {
$result .= self::getHTML($f);
}
} else {
$result = getHTML(self::$base . self::$prodJS);
}
return $result;
}
开发者ID:AymericFrey,项目名称:ProjetBooking,代码行数:25,代码来源:JSLoader.class.php
示例8: getCast
function getCast($tt, &$title = '')
{
$html = getHTML($tt);
if (preg_match('#<h3 itemprop="name">[\\s\\S]+?</h3>#i', $html, $match)) {
$title = _clean($match[0]);
// var_dump($title);
}
if (preg_match('#<table class="cast_list">([\\s\\S]+?)</table>#i', $html, $match)) {
$table = $match[1];
// preg_match_all('#itemprop="actor"[^<]+([\s\S]+?)</td>#', $table, $matches);
// $actors = array_map(
preg_match_all('#itemprop="actor"[\\s\\S]+?href="/name/(nm\\d+)[^>]+>([\\s\\S]+?)</a>#i', $table, $matches);
$ids = array_map('_clean', $matches[1]);
$actors = array_map('_clean', $matches[2]);
// print_r($ids);
$actors = array_combine($ids, $actors);
// print_r($actors);
preg_match_all('#<td class="character">([\\s\\S]+?)(?:\\(|/ \\.|</td)#i', $table, $matches);
$characters = array_map('_clean', $matches[1]);
$characters = array_combine($ids, $characters);
// print_r($characters);
return (object) compact('actors', 'characters');
}
}
开发者ID:rudiedirkx,项目名称:IMDb-Intersect,代码行数:24,代码来源:search.php
示例9: getHTML
<?php
$html = getHTML('http://themoneyballunion.com/game/StatsLab//widget.php?stat=pwar&topX=10', 10);
$html = utf8_encode($html);
echo $html;
?>
</div>
<div id='panel3' class="panel">
<h3>HR leaders</h3>
<?php
$html = getHTML('http://themoneyballunion.com/game/StatsLab//widget.php?stat=hr&topX=10', 10);
$html = utf8_encode($html);
echo $html;
?>
<h3>Hit leaders</h3>
<?php
$html = getHTML('http://themoneyballunion.com/game/StatsLab//widget.php?stat=h&topX=10', 10);
$html = utf8_encode($html);
echo $html;
?>
</div>
</aside>
<div class="news">
<h2>Breaking News</h2>
<div class="articles">
<?php
include 'simple_html_dom.php';
//set up curl
$ch = curl_init("http://www.themoneyballunion.com/game/lgreports//leagues/league_100_home.html");
开发者ID:Happy-Gojira,项目名称:TMBU,代码行数:31,代码来源:phpTest.php
示例10: define
require 'helper/ClusterHelper.php';
require 'helper/ColumnFamilyHelper.php';
require 'helper/MX4J.php';
require 'conf.inc.php';
define('MINIMUM_THRIFT_API_VERSION_FOR_COUNTERS', '19.10.0');
$cluster_helper = new ClusterHelper($CASSANDRA_CLUSTERS);
session_start();
// Make sure the cluster index in the session still exists in the config array
if ($cluster_helper->getClusterIndex() > $cluster_helper->getClustersCount() - 1) {
$_SESSION['cluster_index'] = 0;
}
try {
$random_server = $cluster_helper->getRandomNodeForCurrentCluster();
$sys_manager = new SystemManager($random_server, $cluster_helper->getCredentialsForCurrentCluster(), 1500, 1500);
} catch (TException $e) {
die(getHTML('header.php') . getHTML('server_error.php', array('error_message' => displayErrorMessage('cassandra_server_error', array('error_message' => $e->getMessage())))) . getHTML('footer.php'));
}
/*
Get the specified view and replace the php variables
*/
function getHTML($filename, $php_params = array())
{
if (!file_exists('views/' . $filename)) {
die('The view ' . $filename . ' doesn\'t exist');
}
// If we got some params to be treated in php
extract($php_params);
ob_start();
include 'views/' . $filename;
$content = ob_get_contents();
ob_end_clean();
开发者ID:nyo16,项目名称:Cassandra-Cluster-Admin,代码行数:31,代码来源:kernel.inc.php
示例11: scrape_between
return $res;
}
function scrape_between($data, $start, $end)
{
$data = stristr($data, $start);
// Stripping all data from before $start
$data = substr($data, strlen($start));
// Stripping $start
$stop = stripos($data, $end);
// Getting the position of the $end of the data to scrape
$data = substr($data, 0, $stop);
// Stripping all data from after and including the $end of the data to scrape
return $data;
// Returning the scraped data from the function
}
$result = getHTML("http://www.snapdeal.com/product/hp-stream-8-windows-tablet/672158959721?", 0);
function getTitle($result)
{
preg_match('/(.*)<\\/h1>/i', $result, $title);
$ret = scrape_between($title[0], '<h1 itemprop="name" class=\'font20\'>', "</h1>");
return $ret;
}
function getImg($result, $title)
{
preg_match_all('/<img title=(.*) itemprop="image" (.*)>/i', $result, $img);
$img_url = scrape_between($img[0][0], 'src="', '"');
return $img_url;
}
function getMRP($result)
{
preg_match_all('/original-price-id">(.*)</i', $result, $MRP);
开发者ID:ankurdebnath,项目名称:WebProjects,代码行数:31,代码来源:scrap.php
示例12: init
/**
* entry point
*/
function init()
{
try {
//connect to database
$db = new PDO("mysql:host=" . DB_HOST . ";dbname=" . DB_NAME, DB_USER, DB_PASSWORD);
$preparedParams = array();
$statuses = $_POST["statuses"];
$html = "";
$pagingStatus = null;
$filter = "";
$sort = "";
$query = "";
if (isset($statuses)) {
//statuses => array
$statuses = json_decode(urldecode($statuses));
foreach ($statuses as $key => $value) {
switch ($value->action) {
case "paging":
$pagingStatus = $value;
break;
case "filter":
$filter .= getFilterQuery($value, $filter, $preparedParams);
break;
case "sort":
$sort = getSortQuery($value, $preparedParams);
break;
}
}
}
//count database items for pagination
$query = "SELECT count(*) FROM Item " . $filter . " " . $sort;
if (count($preparedParams) > 0) {
$stmt = $db->prepare($query);
//error_log(print_r($preparedParams, true));
$stmt->execute($preparedParams);
$count = $stmt->fetchColumn();
} else {
$count = $db->query($query)->fetchColumn();
}
//init pagination query
if ($pagingStatus) {
$paging = getPagingQuery($pagingStatus, $count, $preparedParams);
}
//init query with sort and filter
$query = "SELECT title, description, image, likes, keyword1, keyword2 FROM Item " . $filter . " " . $sort . " " . $paging;
if (count($preparedParams) > 0) {
$stmt = $db->prepare($query);
$stmt->execute($preparedParams);
$items = $stmt->fetchAll();
} else {
$items = $db->query($query);
}
foreach ($items as $item) {
$html .= getHTML($item);
}
//print html
echo getHTMLWrapper($html, $count);
//close the database connection
$db = NULL;
} catch (PDOException $ex) {
print 'Exception: ' . $ex->getMessage();
}
}
开发者ID:erekle1,项目名称:adrenalini,代码行数:66,代码来源:server-html.php
示例13: while
<?php
/*
Stap3:
Het dowlaoden van alle posts en op te slaan
*/
//Open de csv waar de links in staan
if ($cvs = fopen("postList.csv", "r")) {
//Voor elke relge gevodne in csv haal data op
while ($data = fgetcsv($cvs, 1000, ",")) {
//Haal de html op
getHTML($data[1]);
//Als er geen data gevodnen is geef een error
if (!$html) {
echo "There is no data found on this page\n";
} else {
//Open de locatie waar je het bestand wil opslaan en maar het bestand aan met als bestan naam de laaste gedeelte van de link
$file = fopen('/var/www/test/bayw/allPost/' . str_replace($data[1], "", "site naam"), 'w');
//Zet de html in het bestand
fputs($file, $html);
//sluit bestand
fclose($file);
}
//Vertraag het script voor 2 sec om overload te voor komen
sleep(2);
}
//sluit de csv
fclose($cvs);
}
开发者ID:Beertie,项目名称:web_scraper,代码行数:29,代码来源:step3.php
示例14: create
function create($entity)
{
$html = getHTML($entity['source_url']);
if (!$html) {
return error_log('Could not import ' + $entity['source_url']);
}
// Clean title
$entity['title'] = trim(html_entity_decode($entity['title'], ENT_COMPAT, 'UTF-8'));
// Generate key
$entity['key'] = 'ch/' . makeSlug($entity['title']);
// Extract email
$emailLink = $html->find('table.tabelleESK a[href^=mailto:]', 0);
if ($emailLink) {
$entity['email'] = str_replace('mailto:', '', trim($emailLink->href));
}
// Extract URL
foreach ($html->find('table.tabelleESK tr') as $row) {
$name = trim($row->children(0)->innertext);
if (stripos('homepage', $name) !== false) {
foreach ($row->children() as $i => $cell) {
$link = $cell->find('a[href]', 0);
if ($link) {
$entity['url'] = $link->href;
break;
}
// Ugly case: URL but no link
if ($i && !$cell->children()) {
$entity['url'] = $cell->innertext;
break;
}
}
}
}
// Find entity abbreviation
$orgTitle = $html->find('h2.titleOrg', 0);
if ($orgTitle) {
$orgTitleParts = explode('-', $orgTitle->innertext);
if (count($orgTitleParts) > 1) {
$entity['abbr'] = trim(array_pop($orgTitleParts));
$entity['abbr'] = html_entity_decode($entity['abbr'], ENT_COMPAT, 'UTF-8');
}
} else {
error_log('No title on ' + $entity['source_url']);
}
// Find entity address
$infoBlock = $html->find('div.infoblock', 0)->innertext;
if (preg_match('/<\\/h2>(.+?)<div class="titleContent">/s', $infoBlock, $matches)) {
$infoBlock = str_replace(array('<br>', '(neues Fenster)'), array(', ', ''), $matches[1]);
$infoBlock = preg_replace('/\\s\\s+/', ' ', $infoBlock);
$infoBlock = trim(html_entity_decode(strip_tags($infoBlock), ENT_COMPAT, 'UTF-8'));
$entity['address'] = $infoBlock;
}
save($entity);
getChildren($entity, $html);
}
开发者ID:flyeven,项目名称:scraperwiki-scraper-vault,代码行数:55,代码来源:public_bodies_of_the_swiss_federation.php
示例15: init
function init()
{
if (empty($_POST['letters']) || empty($_POST['wordlen'])) {
$html = getHTML(1);
} else {
$letters = trim($_POST['letters']);
//Remove spaces in between
$letters = strtolower(str_replace(' ', '', $letters));
$wordlen = intval($_POST['wordlen']);
if ($wordlen <= strlen($letters)) {
$success = getMatches($letters, $wordlen);
$html = getHTML(0, $success);
} else {
$success = array();
$html = getHTML(0, $success);
}
}
echo $html;
}
开发者ID:ravikiranj,项目名称:misc-tools,代码行数:19,代码来源:index.php
示例16: while
// Attempt to find proper directory from current page to Root ...
$numAttempts = 0;
while (!file_exists($extension . $pathFile) && $numAttempts < 5) {
$extension = '../' . $extension;
$numAttempts++;
}
require $extension . $pathFile;
require 'SeriesManager.php';
// Need to define values as Global to be used between functions
$seriesArray = '';
$editLink = '';
// now we drive the application by calling the loadData(), processData(),
// and getHTML() routines
loadData();
processData();
echo getHTML();
//************************************************************************
/**
* loadData()
*
* Here we load up all the data we need to run this web page.
*/
function loadData()
{
global $seriesArray;
global $editLink;
// Get a list of all the series entries in the table
$seriesArray = array();
$seriesManager = new RowManager_SeriesManager();
// get all the rows in this table
$list = $seriesManager->getListIterator();
开发者ID:andrewroth,项目名称:c4c_intranet,代码行数:31,代码来源:ex_SeriesList.php
示例17: getJS
<script type="text/javascript">
try {
<?php
echo getJS();
?>
} catch (e) {
console.error(e.message);
parent.window.onDifferent('Error');
}
$(function () {
<?php
@(include "{$path}/unit-tests.js");
?>
});
</script>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<?php
echo getHTML($_GET['which']);
?>
</body>
</html>
开发者ID:cxt521,项目名称:highcharts.com,代码行数:30,代码来源:compare-iframe.php
示例18: microtime
if (isset($_GET['keyspace_name'])) {
$keyspace_name = $_GET['keyspace_name'];
}
try {
$time_start = microtime(true);
$sys_manager->drop_keyspace($keyspace_name);
$time_end = microtime(true);
$_SESSION['success_message'] = 'drop_keyspace';
$_SESSION['keyspace_name'] = $keyspace_name;
$_SESSION['query_time'] = getQueryTime($time_start, $time_end);
redirect('index.php?success_message=drop_keyspace');
} catch (Exception $e) {
$_SESSION['error_message'] = 'drop_keyspace';
$_SESSION['keyspace_name'] = $keyspace_name;
$_SESSION['message'] = $e->getMessage();
redirect('index.php?error_message=drop_keyspace');
}
}
if (!$included_header) {
echo getHTML('header.php');
if (!$is_valid_action) {
// No action specified
if (empty($action)) {
echo displayErrorMessage('no_action_specified');
} else {
echo displayErrorMessage('invalid_action_specified', array('action' => $action));
}
}
}
echo getHTML('footer.php');
开发者ID:nyo16,项目名称:Cassandra-Cluster-Admin,代码行数:30,代码来源:keyspace_action.php
示例19: init
/**
* entry point
*/
function init()
{
try {
$statuses = $_POST["statuses"];
$sort = "";
$filterArr = array();
$filter = "";
$paging = "";
$pagingStatus = null;
$query = "";
$html = "";
//error_log(urldecode($_POST["statuses"]));
if (isset($statuses)) {
//statuses => array
$statuses = json_decode(urldecode($statuses));
foreach ($statuses as $key => $value) {
switch ($value->action) {
case "paging":
$pagingStatus = $value;
break;
case "filter":
$filter .= getFilterQuery($value, $filter);
break;
case "sort":
$sort = getSortQuery($value);
break;
}
}
//connect to SQLite database
$db = new PDO("sqlite:jplist.db");
//increases sqlite performance by turning syncing off
$db->exec("pragma synchronous = off;");
//count database items for pagination
$query = "SELECT count(*) FROM Item " . $filter . " " . $sort;
$count = $db->query($query)->fetchColumn();
//init pagination query
if ($pagingStatus) {
$paging = getPagingQuery($pagingStatus, $count);
}
//init query with sort and filter
$query = "SELECT title, desc, img, likes, keyword1, keyword2 FROM Item " . $filter . " " . $sort . " " . $paging;
//select items
$items = $db->query($query);
foreach ($items as $item) {
$html .= getHTML($item);
}
//init array for json data
//$json_arr = array("html" => utf8_encode($html), "data" => array("count" => $count), "query"=> $query);
//print html
echo getHTMLWrapper($html, $count);
//close the database connection
$db = NULL;
}
} catch (PDOException $ex) {
print 'Exception: ' . $ex->getMessage();
}
}
开发者ID:gjasonsmith12,项目名称:jplist,代码行数:60,代码来源:server.php
示例20: getHTML
<?php
include "parse.php";
$gameName = $_POST["gameName"];
$url = "http://store.steampowered.com/search/?snr=1_7_7_151_12&term=" . $gameName;
$html = getHTML($url);
preg_match_all("/data-ds-appid.*\"([0-9]+)\"/", $html, $match_id, PREG_PATTERN_ORDER);
preg_match_all("/search_capsule\">(.*)alt/", $html, $match_logo, PREG_PATTERN_ORDER);
preg_match_all("/title\">(.*)</", $html, $match_title, PREG_PATTERN_ORDER);
$i = 0;
foreach ($match_title[1] as $title) {
echo "<a href=\"http://localhost/greesha/getbestdeal/result/prices.php?name=" . $title . "&&id=" . $match_id[1][$i] . "\">";
echo "<p>" . $title . "</p>";
echo "</a>";
++$i;
}
开发者ID:GrigoriyMikhalkin,项目名称:gbd,代码行数:16,代码来源:games.php
注:本文中的getHTML函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论