Created
October 26, 2012 12:14
-
-
Save Techmind/3958454 to your computer and use it in GitHub Desktop.
demo google play parser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$content = file_get_contents('https://play.google.com/store'); | |
var_dump(strlen($content)); | |
preg_match_all("~<a href=\"(/store/apps/category/[A-Z_]*)~", $content, $matches); | |
$cats = array_unique($matches[1]); | |
var_dump($cats); | |
$link2 = 'https://play.google.com/' . $cats[1]; | |
$content2 = file_get_contents($link2) . "/collection/topselling_paid?start=0"; | |
preg_match_all("~<a href=\"(/store/apps/details[^\"]*)~", $content2, $matches2); | |
$detailed = array(); | |
$d_was = null; | |
$detailes = $matches2[1]; | |
foreach ($detailes as $det_url) { | |
$link3 = 'https://play.google.com/' . $det_url . "&hl=en"; | |
$detailed = file_get_contents($link3); | |
preg_match('~<div class="doc-banner-icon"><img ?(?:itemprop="image" ?)?src="([^"]*)"/>~', $detailed, $matches_det_img); | |
preg_match('~<td class="doc-banner-title-container"><h1 ?(?:itemprop="name" ?)?class="doc-banner-title">([^<]*)<~', $detailed, $matches_det_n); | |
echo "$link3; {$matches_det_img[1]}, {$matches_det_n[1]}\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Result is:
https://play.google.com//store/apps/details?id=boris.pref&feature=top-paid&hl=en; https://lh5.ggpht.com/31dI91KiRzih7XhCS_uYkkRB59atbHQbwZK0gXvNAeCJJ2LIwvfaLZPZyZ7hfpdliw=w124, Pref
https://play.google.com//store/apps/details?id=com.kb.mob&feature=top-paid&hl=en; https://lh5.ggpht.com/bNfnMtiQ98UVFHrmPpAK8hnGi0F_64HO4P579KRM4MpBRGs2P3QU-2mchBhMG441C0c=w124, Backgammon Masters
https://play.google.com//store/apps/details?id=ru.uralgames.thousandplus.android.paid&feature=top-paid&hl=en; https://lh4.ggpht.com/dbtJcaqXC6wLIMQOQ3ecYAntDOIDtMOj__hOF4nDbEiHHJgNnVDgbXNrockxWlnDetA=w124, Thousand+ (Ad-Free)
https://play.google.com//store/apps/details?id=com.xtreme.kingkey&feature=top-paid&hl=en; https://lh5.ggpht.com/eXouJYdfCTqAKHPPD2Uyam6aZ0QOXSkSqUP4quHye6Ndwf5td5aevyCmfGJmmXSAhfwV=w124, King Key
https://play.google.com//store/apps/details?id=ru.wedroid.durak.full&feature=top-paid&hl=en; https://lh4.ggpht.com/MDilNx-QgXWS0G9VIws5qNImUo7dOb3Dz7fTng2cGbPBbQHV-m9knwq8dGcXl34LGA=w124, Russian Fool Card Game HD
https://play.google.com//store/apps/details?id=com.xtreme.ninekey&feature=top-paid&hl=en; https://lh6.ggpht.com/kwtzduCX6UfuwrVtA_O5t3y8z4aTWaBjVtxJT_MeowEz0G8qhePGsNJKGYnB6j30nfpp=w124, Nine Key
https://play.google.com//store/apps/details?id=com.brainium.solitaire&feature=top-paid&hl=en; https://lh3.ggpht.com/92Hf83ZkHhunmPn-IULL9lF2qfQETuv171BWiuVB0f0eDyvtP5wQ68mb4AG5dRx-djg=w124, Solitaire+
https://play.google.com//store/apps/details?id=com.gameloft.android.ANMP.GloftTHM2.ML&feature=top-paid&hl=en; https://lh3.ggpht.com/lSUIGNCQF8A5kwZ3hgI74H4_SusArFLUuHisHPSZd_vPau6QAvz3Iv9KFWjuisrosiM=w124, Texas Hold'em Poker 2
https://play.google.com//store/apps/details?id=com.silvercrk.solitaire_iv&feature=top-paid&hl=en; https://lh5.ggpht.com/AQwSGpkWLjnvFVTLSnIfxmIhbhZR2hSMHYd1sqWIkvbRHZ4Z03jE5-b7f5adyyY9dBsP=w124, Hardwood Solitaire IV
https://play.google.com//store/apps/details?id=com.gameloft.android.ANMP.GloftPSO3.ML&feature=top-paid&hl=en; https://lh3.ggpht.com/y8BAf-bTn8IRJkizYl9eCiJ65QDcvXbga8Tdq0gLt0UYUUIb7wGXDJBNAlEFrwUsXSw=w124, Platinum Solitaire 3
https://play.google.com//store/apps/details?id=com.brainium.spider&feature=top-paid&hl=en; https://lh4.ggpht.com/ceLGTEWSd8lbX1I2okNYw7hi0DajBd_1cYNtYg-gREQXxkGP3AbcRgDeMQBAMQUyDck=w124, Spider Solitaire+
https://play.google.com//store/apps/details?id=com.apostek.SlotMachine.paid&feature=top-paid&hl=en; https://lh4.ggpht.com/cpRUw9SszxDkZeTHy78VNiSYrDP2KG5f4vQod7TgzEqV_QDcWwLep_3XVEXZ3_ndNk0=w124, Slot Machine +
https://play.google.com//store/apps/details?id=com.silvercrk.backgammon_thd&feature=top-paid&hl=en; https://lh3.ggpht.com/MZjTSHyABlhsC-1fY5gXHQIwFijol8NQcpvyIlJfDQ_hnWqoFAEyVIS-E1zhi_Gfqas=w124, Hardwood Backgammon
https://play.google.com//store/apps/details?id=c2ma.android.GovernorOfPoker.installer&feature=top-paid&hl=en; https://lh3.ggpht.com/6eig_EqTDT0rS2jAaITE58UOb0I0QnWgI1g65Agxi2LYqZJ6sclbZ-Dx6oJCg5gsg3X6=w124, Governor of Poker
https://play.google.com//store/apps/details?id=com.pokiemagic.EgyptianDreams4&feature=top-paid&hl=en; https://lh6.ggpht.com/vdyyLUeqceWW2q37udpRZ9lLrjcfn_kC_gEO_WqNiLCFrAOWWE2Q99ELdQtg0_RUag=w124, Egyptian Dreams 4 Slots
https://play.google.com//store/apps/details?id=com.greatgameproducts.abridgebaron&feature=top-paid&hl=en; https://lh4.ggpht.com/tIi1KOxtBYUi3uIpPG0tOnDsmosyZ9NEEsKA9OfSRvXOiZ1raiffyoULAkvHuQc1-ro=w124, Bridge Baron
https://play.google.com//store/apps/details?id=dominofull.ndroidz.com&feature=top-paid&hl=en; https://lh5.ggpht.com/MQolmH6Q1UywiNQEm2QMCNSxSK-AfKIHyUg5KpqVcIl51m-ci4ntmFTiu_tluoEa0Q=w124, Dominoes Deluxe
https://play.google.com//store/apps/details?id=com.paragon.android.solitaire&feature=top-paid&hl=en; https://lh4.ggpht.com/QAUy2dwpbOlUMhjqTk5YWStSYAtEIKAkLahL93VCpU2nOcd2ygjcHCipJ1MrMsgzoZk=w124, Can't Stop Solitaire
https://play.google.com//store/apps/details?id=com.pokiemagic.MysticGenie&feature=top-paid&hl=en; https://lh5.ggpht.com/-xmp80LMzIZFPQrzNw5F06T84-P5V5RehgW-R-_GqeE_mIUnbMWwT_UbrhDcQr2yoA=w124, Mystic Genie Slots
https://play.google.com//store/apps/details?id=com.gemego.texasmate&feature=top-paid&hl=en; https://lh4.ggpht.com/0hML8Fxs6jmRoeAfMigRLwml7QpWtLRmY6KeLGAjZcK3atqzQvCWVjupzgGntCgt0JY=w124, Poker Odds Calculator
https://play.google.com//store/apps/details?id=yahtzeefull.reznic.net&feature=top-paid&hl=en; https://lh6.ggpht.com/cZR-ZM6M9nCy2hiPnDXyxnbj85BSVeR1lmFrd58uYg_iLNCTZbaMHshVMceLB-OYY4A=w124, Yahtzy Online
https://play.google.com//store/apps/details?id=com.tesseractmobile.solitairemulti&feature=top-paid&hl=en; https://lh3.ggpht.com/_R9DiXp-JHv7WQb30nQkEDr2UKkmSb5SJ7aWHni31WQqyc1vOD6fNj3lDfk6d0hIkxVU=w124, Solitaire MegaPack
https://play.google.com//store/apps/details?id=dominofull.reznic.net&feature=top-paid&hl=en; https://lh3.ggpht.com/C1ZOTDwzMKhRd-UnO5pJt3334WQOPw40cBEMO4M0kaJIOXQWsVShx2o2VB096fui4oko=w124, Dominoes Online
https://play.google.com//store/apps/details?id=com.odesys.spider&feature=top-paid&hl=en; https://lh5.ggpht.com/AtBuzIV0URKXUKXwX9XEXZYll5ACsC5v_sp16QMc8hoibElAYx3dJaAv0IUZg4IBZrov=w124, Spider
https://play.google.com//store/apps/details?id=ru.appscraft.durak&feature=top-free&hl=en; https://lh4.ggpht.com/Ilw5TwXouMDBNNlnfzI_ZfqYR_xG96UzAeEK3etQs-AcH5b1of82wOo6gXtkhJ3Avw=w124, Durak Elite
https://play.google.com//store/apps/details?id=org.aastudio.games.longnards&feature=top-free&hl=en; https://lh4.ggpht.com/CLPO_yBj6tCG5l03avSjqEw17vrSbDJKeiB2InnSLNVfLVCLX3gUDfRaT2Gd3IuxjrCO=w124, Backgammon - Narde
https://play.google.com//store/apps/details?id=com.anoshenko.android.fav_solitaires&feature=top-free&hl=en; https://lh4.ggpht.com/sYdSL88g3A-lDo_BqdaVgJXj8avS6ZNGR6lkT3tE7sLprvtO8tqSB2lH8GU6ILIkXNo=w124, Любимые пасьянсы
https://play.google.com//store/apps/details?id=com.vulkan&feature=top-free&hl=en; https://lh3.ggpht.com/k9hGfE6F8klHt3XURXK3Wj_Woa1fNvYQokmIT2_0vkm_GITCebYfSmSg6DcowiPSHw=w124, Вулкан - игровые автоматы
https://play.google.com//store/apps/details?id=net.greatslotmachine&feature=top-free&hl=en; https://lh3.ggpht.com/gsIOCePjmDcKNK0Dth8WGWgNZdksQtczv45yaBiHVvQ11-RJZtRO-xFEh_7Wjta7H1I=w124, Great slot machines
https://play.google.com//store/apps/details?id=com.favler.russian.roulette&feature=top-free&hl=en; https://lh5.ggpht.com/7mD5UMXZMuSmirw7jP8UQ00myHosGctAWBIp1lVl3yOo_L-en7o2DRFadtkXJzvDvQ=w124, Russian Roulette
https://play.google.com//store/apps/details?id=com.softick.android.solitaire.klondike&feature=top-free&hl=en; https://lh3.ggpht.com/wmefnxZc-0JfKB4QcpQvyb8zhJAyo_gVDypiurChKiZgOVWis4KI-N3_i1b9tPVP1g=w124, Solitaire
https://play.google.com//store/apps/details?id=ru.uralgames.durakplus.android&feature=top-free&hl=en; https://lh6.ggpht.com/WmlTX_0SwN-538oWmPGkCUh8dNDGiX8C4ouij3qgZSfwmq-nFRoVpzozqSVpojKzVlI=w124, Durak+
https://play.google.com//store/apps/details?id=com.luckylabs.luckybingo&feature=top-free&hl=en; https://lh6.ggpht.com/dTT1IENU3nne-fAQgz5sGQ5yyVH5UREX9d0SUqoRow0F9Hk98xDLh_KSjc9cfiQEn2k=w124, Lucky Bingo
https://play.google.com//store/apps/details?id=com.leftover.CoinDozer&feature=top-free&hl=en; https://lh5.ggpht.com/HksdBy8vQSDAFQAt4t-6WwVZiO1TO7LUkkLKJLjuaZDBpEkT_LaaS6LpizSu48BcHQ=w124, Coin Dozer
https://play.google.com//store/apps/details?id=ru.uralgames.thousandplus.android&feature=top-free&hl=en; https://lh5.ggpht.com/Bqzjv6olECS7Q8hW_6Sb92-Vs4tNNXSJF74FODgzzGa9MZpTchLeWCyZ3JsABnKJzkQ=w124, Thousand+
https://play.google.com//store/apps/details?id=com.plarium.pokershark&feature=top-free&hl=en; https://lh5.ggpht.com/L5aGA_7-n0Z5a4mQN0SymoH1T08q4JNT0BLfr6GYwIg-8LpcE2pKbY3Agu2wlVV4aw=w124, Poker Shark
https://play.google.com//store/apps/details?id=com.dragonplay.liveholdempro&feature=top-free&hl=en; https://lh4.ggpht.com/dg9hBZspyfL-CVlD4c2d-OT3IC34-WARDOFFi6RiTgxz8QREZHv3XfJqxzP23nWLS80=w124, Live Holdem Poker Pro
https://play.google.com//store/apps/details?id=air.com.playtika.slotomania&feature=top-free&hl=en; https://lh3.ggpht.com/h9v4kCf3MmdOJXHX_n6g0uTwyb1AWwyqx3K4gW37PLQrIXJkjx70coB16HNsmqy5tA=w124, Slotomania - slot machines
https://play.google.com//store/apps/details?id=air.com.bitrhymes.bingo&feature=top-free&hl=en; https://lh5.ggpht.com/MENFfU3dX0iuYUPLp00cy1kRF6gxWvXpypOQfurxrsyge9MCxRIIPqwIHSqhudcfaA=w124, Bingo Bash
https://play.google.com//store/apps/details?id=ru.appscraft.dominoes&feature=top-free&hl=en; https://lh3.ggpht.com/3eI9Tr83ej74Mug4F2kR-gN8bo3U5ESOUg6l6cvGZvtnV1ryXB0GW4qIbwivQuvuiF01=w124, Dominoes Elite
https://play.google.com//store/apps/details?id=ua.Apostroff.GameDurak&feature=top-free&hl=en; https://lh6.ggpht.com/Abmk-rqpuxwqNwtMzQu6S76mN6xrDNZQUy8lU-Zm5L1sLT_1HgJz3hd0JIMLaZ4Re8o=w124, Card game Durak
https://play.google.com//store/apps/details?id=com.kamagames.pokerist&feature=top-free&hl=en; https://lh4.ggpht.com/9w5-1XeskED3gPDNTVtg1vDRm3BjG1x5tIAoy95WydXLWru0uejJTEGNSRVkk0FpqJw=w124, Texas Poker
https://play.google.com//store/apps/details?id=com.cucgames.fruit_coctail&feature=top-free&hl=en; https://lh5.ggpht.com/at4nctvaXiM4-fe6-_1oCMctoIJh4YLqtsW3hfadDlI6JW8tQic1lW9q8f89Lcg0XpE=w124, Fruit Cocktail slot machine
https://play.google.com//store/apps/details?id=air.com.luckylabs.luckyslots&feature=top-free&hl=en; https://lh3.ggpht.com/BBbjcdJl8FK-QR_0XWlzE-eLsND3TjZ0kBK7FtuldJzlSghS2a6lDXt8FtXu8LkHidI=w124, Lucky Super Slots
https://play.google.com//store/apps/details?id=com.cucgames.crazymonkey&feature=top-free&hl=en; https://lh6.ggpht.com/YCTPHsf9TXbAIrR3Uanr2VTofL7anG04DGZPja2_iH3_0Wn04lJZZXHFd4xwWII2T3U=w124, Crazy Monkey slot machine
https://play.google.com//store/apps/details?id=com.kiwifruitmobile.sudoku&feature=top-free&hl=en; https://lh5.ggpht.com/VU9aXV6Qrf4BPVTyXIO1goSkPbtpzUDP9PkYaRXFqfjclixsgbhaXfLlav61DYcm1g=w124, Super Sudoku
https://play.google.com//store/apps/details?id=com.cucgames.resident&feature=top-free&hl=en; https://lh3.ggpht.com/qsaTUHoHG0TRgKwkkxs8tHclC1cvwrRgCi52cjxo6VMlnp5lVufC6-QhTZkGEXGYQ6E=w124, Resident slot machine
https://play.google.com//store/apps/details?id=org.aastudio.games.backgammon&feature=top-free&hl=en; https://lh6.ggpht.com/HqKycCOQjt3MV2f_XFwXzZfRCfeNrRexJtUScoZfL7m8EwmUV_7LgXrX7ZUM5rgT-Ys=w124, Backgammon