Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 653376 Details for
Bug 880752
[abrt] php-cli-5.4.9-1.fc17: _zend_mm_free_int: Process /usr/bin/php was killed by signal 11 (SIGSEGV)
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
catalog-parser.php
catalog-parser.php (text/plain), 3.06 KB, created by
Remi Collet
on 2012-11-28 09:11:35 UTC
(
hide
)
Description:
catalog-parser.php
Filename:
MIME Type:
Creator:
Remi Collet
Created:
2012-11-28 09:11:35 UTC
Size:
3.06 KB
patch
obsolete
>#!/usr/bin/php ><?php >include 'simple_html_dom.php'; >// гоÑод, каÑегоÑиÑ, подкаÑегоÑиÑ, ÐдÑеÑ, ТелеÑон, Email , СайÑ, ÐÑÐµÐ¼Ñ ÑабоÑÑ, >// http://www.62.ua/info/citysites > >function cache_get_html($link) { > $tmp = 'cache/'.md5($link); > if (file_exists($tmp)) { > $str = file_get_contents($tmp); > } else { > $str = file_get_contents($link); > file_put_contents($tmp, $str); > } > return ($str ? str_get_html($str) : NULL); >} > >function usedmem() { > return sprintf("\t(%.2f)\n", memory_get_usage()/1024/1024); >} > >function processCity($cityName, $cityLink) >{ > echo "$cityName: $cityLink\n"; > > $html = cache_get_html($cityLink.'/catalog'); > > foreach($html->find('div.cat_menu a[data-id]') as $catLink) { > echo " {$catLink->plaintext}\n"; > $catId = $catLink->getAttribute('data-id'); > foreach($html->find("#parent_$catId a[data-id]") as $subcatLink) { > echo "\t{$subcatLink->plaintext}: $cityLink{$subcatLink->href}".usedmem(); > processCategory($cityName, trim($catLink->plaintext), trim($subcatLink->plaintext), $cityLink, $subcatLink->href); > } > } >} > >function processCategory($cityName, $catName, $subcatName, $cityLink, $subcatLink) >{ > $pid = pcntl_fork(); > if ($pid>0) { > pcntl_waitpid($pid, $status); > } else { > $csv = fopen('citysites.csv', 'a'); > > $html = cache_get_html($cityLink.$subcatLink); > foreach($html->find('div.company_box h2 a') as $a) { > echo "\t {$a->href}".usedmem(); > parseCompany($csv, $cityName, $catName, $subcatName, $cityLink, $a->href); > } > fclose($csv); > exit(0); > } >} > >function parseCompany($csv, $cityName, $catName, $subcatName, $cityLink, $companyLink) >{ > $company = array(); > > $html = cache_get_html(substr($companyLink,0,14) == '/catalog/full/' ? $cityLink.$companyLink : $companyLink); > if ($html) foreach($html->find('div.info div.block_info div.info_box') as $ib) { > $company[trim($ib->childNodes(0)->plaintext)] = trim($ib->childNodes(1)->plaintext); > } > > $line = array( > $cityName, > $catName, > $subcatName, > empty($company['ÐдÑеÑ']) ? '' : $company['ÐдÑеÑ'], > empty($company['ТелеÑон']) ? '' : $company['ТелеÑон'], > empty($company['Email адÑеÑ']) ? '' : $company['Email адÑеÑ'], > empty($company['СайÑ']) ? '' : $company['СайÑ'], > empty($company['ÐÑÐµÐ¼Ñ ÑабоÑÑ']) ? '' : $company['ÐÑÐµÐ¼Ñ ÑабоÑÑ'], > ); > fputcsv($csv, $line, ';'); >} > >// truncate >$csv = fopen('citysites.csv', 'w'); >fclose($csv); >/* >$citysites = file_get_html('http://www.62.ua/info/citysites'); >foreach($citysites->find('td.contact a') as $link) { > processCity($link->plaintext, $link->href); >} >*/ >processCity('ÐдеÑÑа', 'http://www.048.ua'); >//processCategory('ÐдеÑÑа', 'ÐвÑо', 'ÐваÑийное вÑкÑÑÑие авÑозамков', 'http://www.048.ua', '/catalog/23/580'); >//parseCompany('ÐдеÑÑа', 'ÐвÑо', 'ÐваÑийное вÑкÑÑÑие авÑозамков', 'http://www.048.ua', 'http://autokluch.048.ua/'); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 880752
:
652987
|
652988
|
652989
|
652990
|
652991
|
652992
|
652993
|
652994
|
652995
|
652996
|
652997
|
652998
|
653056
| 653376