aaronpk / Google-Voice-PHP-API

Unmaintaned: Please do not contact me with support requests. If this no longer works, it's because Google Voice changed their systems. I will accept pull requests that fix things. Check out http://twilio.com for a much better API for sending and receiving SMSs.
Other
228 stars 108 forks source link

'Could not parse for GALX token' #20

Closed matthewTa127 closed 8 years ago

matthewTa127 commented 9 years ago

I not sure what to do to fix this

auctionsjeff commented 8 years ago

Steps I took to fix the same error:

  1. Log the $html variable as part of the "Could not parse" error log message
  2. Look in the log for the string "GALX".
  3. If it's there (was for me), update the RegEx to match the new string Google's ServiceLogin endpoint is producing now (it changed recently it seems).

See my PR for how I fixed the similar (same?) issue I had.

matthewTa127 commented 8 years ago

What are you responding to? On Dec 9, 2015 5:26 PM, "auctionsjeff" notifications@github.com wrote:

Steps I took to fix the same error:

  1. Log the $html variable as part of the "Could not parse" error log message
  2. Look in the log for the string "GALX".
  3. If it's there (was for me), update the RegEx to match the new string Google's ServiceLogin endpoint is producing now (it changed recently it seems).

See my PR https://github.com/aaronpk/Google-Voice-PHP-API/pull/21 for how I fixed the similar (same?) issue I had.

— Reply to this email directly or view it on GitHub https://github.com/aaronpk/Google-Voice-PHP-API/issues/20#issuecomment-163419866 .

jamenlang commented 8 years ago

Google changed their html order of name/type/value to type/name/value.

if (preg_match('/type="hidden"\s_name="GALX"\s_value="([^"]+)"/', $html, $match)) $GALX = $match[1];

I would make a pull request, but i can't figure out how. this is as good as it gets.