Skip to content

Instantly share code, notes, and snippets.

@m6w6
Created February 20, 2015 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m6w6/8847bc10ccdf93dcab17 to your computer and use it in GitHub Desktop.
Save m6w6/8847bc10ccdf93dcab17 to your computer and use it in GitHub Desktop.
Query pecl_http RFC votes
<?php
(new http\Client)->enqueue(
new http\Client\Request("GET", "https://wiki.php.net/rfc/pecl_http"),
function($res) {
$xpath = new DomXpath(@DomDocument::loadHtml($res->getBody()));
$nodes = $xpath->query("//form[@id='doodle__form__add_pecl_http_to_the_core']/table/tbody/tr[last()]/th");
printf("Choice: | %14s | %14s | %14s |\n", "Yes, enabled", "Yes, disabled", "No, no way!");
vprintf("%s | %14d | %14d | %14d |\n", array_map(function($node) {
return $node->textContent;
}, iterator_to_array($nodes)));
}
)->send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment