статья с описанием - http://habrahabr.ru/post/233243/
Поулчаем список городов http://weather.yandex.ru/static/cities.xml https://pogoda.yandex.ru/static/cities.xml
<?php | |
$fp = fopen($cuts_list_file, 'rb'); | |
while(!feof($fp)) | |
{ | |
$line = fgets($fp); //fgets reads one line at a time | |
} |
<?php | |
//via http://stackoverflow.com/questions/6409462/downloading-a-large-file-using-curl | |
function curl_copy($from = '', $to = '', $proxy = '') | |
{ | |
if(empty($from) || empty($to)) | |
{ | |
return false; | |
} |
<?php | |
//to Parser.php | |
public function unparse($str) | |
{ | |
$tags_with_options = array(); | |
$tags_without_options = array(); | |
foreach ($this->bbcodes as $code) | |
{ |
<?php | |
require_once "jBBCode" . DIRECTORY_SEPARATOR . "Parser.php"; | |
/** | |
* Implements an [img=alt] tag that supports an optional class argument. | |
* | |
*/ | |
class ImageWithClass extends \JBBCode\CodeDefinition | |
{ |
<?php | |
require_once "jBBCode" . DIRECTORY_SEPARATOR . "Parser.php"; | |
/** | |
* Implements a [list] code definition that provides the following syntax: | |
* | |
* [list] | |
* [*] first item | |
* [*] second item |
<?php | |
//via http://php.net/manual/en/function.getimagesize.php#109063 | |
$header = unpack('@6/vwidth/vheight', $binaryData); | |
$width = $header['width'] | |
$height = $header['height']; |
статья с описанием - http://habrahabr.ru/post/233243/
Поулчаем список городов http://weather.yandex.ru/static/cities.xml https://pogoda.yandex.ru/static/cities.xml
http://www.cbr.ru/scripts/Root.asp?PrtId=SXML - документация http://www.cbr.ru/scripts/XML_daily.asp?date_req=21/11/2013 - пример запроса
https://openexchangerates.org/
Получаем ключ к API. Валюты легко конвертятся через базовую валюту.
Для отображения собственной рекламы, при отсутствии рекламы из octobird, добавляется параметр passback с собственным обработчиком.
<div class="octobird-block"></div>
<script type="text/javascript">
var _ob = {
sid: YOUR_SITE_ID,
passback: function () {
//ЗДЕСЬ РЕАЛИЗУЕТСЯ ВАША ЛОГИКА, КОТОРАЯ ВЫПОЛНЯЕТСЯ ПРИ ОТСУТСТВИИ РЕКЛАМЫ В OCTOBIRD
console.log('Octobird does not have any ads');
###Важно! Необходимо перед установкой данного кода, удалить наш старый код
<script async src="http://show.octobird.com/ob.js"></script>
<div class="octobird-block"
data-site-id="3510"
data-ad-type="img"
data-ad-number="1"></div>