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 | |
declare(strict_types = 1); | |
// header ( "content-type: text/plain;charset=utf8" ); | |
// https://github.com/divinity76/hhb_.inc.php/blob/master/hhb_.inc.php | |
require_once ('hhb_.inc.php'); | |
function loginGmail(string $username, string $password, string $recoveryEmailChallengeAnswer) : \hhb_curl | |
{ | |
$hc = new hhb_curl('', true); | |
$hc->setopt_array(array( |
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 | |
// Section 5: edit a row | |
// You'll need to get the etag and row ID, and send a PUT request to the edit URL | |
$rowid = 'cre1l'; // got this and the etag from the table data output from section 3 | |
$etag = 'NQ8VCRBLVCt7ImA.'; | |
$url = "https://spreadsheets.google.com/feeds/list/$fileId/od6/private/full/$rowid"; | |
$method = 'PUT'; | |
$headers = ["Authorization" => "Bearer $accessToken", 'Content-Type' => 'application/atom+xml', 'GData-Version' => '3.0']; | |
$postBody = "<entry xmlns=\"http://www.w3.org/2005/Atom\" xmlns:gsx=\"http://schemas.google.com/spreadsheets/2006/extended\" xmlns:gd=\"http://schemas.google.com/g/2005\" gd:etag='"$etag"'><id>https://spreadsheets.google.com/feeds/list/$fileid/od6/$rowid</id><gsx:gear>phones</gsx:gear><gsx:quantity>6</gsx:quantity></entry>"; | |
$req = new Google_Http_Request($url, $method, $headers, $postBody); |