BaseMax / GooglePlayWebServiceAPI

Tiny script to crawl information of a specific application in the Google play/store base on PHP.
MIT License
37 stars 9 forks source link

Iteration #11

Closed IzzySoft closed 3 years ago

IzzySoft commented 3 years ago

Next to some "cosmetic changes", this adds two new fields to the app details:

Also, iteration was added in case protobuf is missing or incomplete. This rarely fires, and is limited to 3 iterations. In my tests, iteration was either not needed at all – or data was there on the first iteration already, so the limit seems absolutely sufficient.

Commits for this PR were collected off-site, and are ready to be merged :laughing:

BaseMax commented 3 years ago

Can you add some example by using this class?

https://github.com/BaseMax/GooglePlayWebServiceAPI/blob/main/example.php

Use Iteration, change default language, and other functions, etc.

IzzySoft commented 3 years ago

Can you add some example by using this class?

I was thinking about moving parts of the ReadMe to a separate page. Maybe the Wiki, with one page per "topic"? That would also give room to explain each field of the returned array without bloating things.

Use Iteration

That's automatic, and takes place when needed:

    $limit = 3;
    while ( empty($values["summary"]) && $limit > 0 ) { // sometimes protobuf is missing, but present again on subsequent call
      $proto = json_decode($this->getRegVal('/data:(?<content>\[\[\[.+?). sideChannel: .*?\);<\/script/ims'));
      if ( empty($proto[0][10]) ) {
        --$limit;
       $this->getApplicationPage($packageName, $lang, $loc);
      } else {
        $values["summary"] = $proto[0][10][1][1];
        break;
      }
    }

The user doesn't need to care or take action.

change default language, and other functions, etc.

That, yes. And if someone discovers that the API doc says "ISO 639-1" (two-letter code) while the default is en_US – well… That user qualified for writing more docs :laughing:

So: Wiki? And: Anything else missing?

BaseMax commented 3 years ago

Documentation? Wiki? It's a very good idea.

with one page per "topic"? That would also give room to explain each field of the returned array without bloating things.

Like

You have strong and good writing. You can write good texts if you want. Thank you for your help in improving and developing. :heart:

Did you access to Wiki? Create/Edit pages? https://github.com/BaseMax/GooglePlayWebServiceAPI/wiki

IzzySoft commented 3 years ago

Yes yes, a nice wiki you've got there, @BaseMax! :smile: Mind if we cleanup the ReadMe then?

Btw: I already have the next PR in preparation here, with some adjustments to the ReadMe included plus a fix to parseSearch() (which was missing to urlencode($search) and thus proviked 400 errors if the search string e.g. contained spaces). I'll just push what I've collected so far – and leave the ReadMe cleanup to you (otherwise people might think I performed a hostile take-over of the project :speak_no_evil: :rofl:).

Enjoy!