Awhile ago the Neowins helped me with some code to display the downloads from the addons download page. https://addons.mozilla.org/en-US/firefox/addon/4780/ But I guess Mozilla changed something and now it stopped working. Can anyone help me again? :D
here is the old code
<?php
function get_mozilla_theme_download_counter($id){
$xpath = new DOMXPath(@DOMDocument::loadHTMLFile(
sprintf(
'https://addons.mozilla.org/en-US/firefox/addon/%d',
$id
)
));
return $xpath->query('//strong[@class="downloads"]')->item(0)->nodeValue;
}
echo get_mozilla_theme_download_counter(4780); #8,379,779
?>
Question
DrJohnSmitherson
Awhile ago the Neowins helped me with some code to display the downloads from the addons download page. https://addons.mozilla.org/en-US/firefox/addon/4780/ But I guess Mozilla changed something and now it stopped working. Can anyone help me again? :D
here is the old code
<?php function get_mozilla_theme_download_counter($id){ $xpath = new DOMXPath(@DOMDocument::loadHTMLFile( sprintf( 'https://addons.mozilla.org/en-US/firefox/addon/%d', $id ) )); return $xpath->query('//strong[@class="downloads"]')->item(0)->nodeValue; } echo get_mozilla_theme_download_counter(4780); #8,379,779 ?>Link to comment
Share on other sites
4 answers to this question
Recommended Posts