Googleスプレッドシートの新しいバージョンでワークシートID

ZendGdataでGoogleスプレッドシートのデータを取得している。
スプレッドシートは順次新しいバージョンになっているが
そのワークシートIDの取得部分でエラーが発生した。

以前はgidが0からの連番で
それに対応した値を入れ込んでいたが
新しいスプレッドシートはバラバラの数になっていて、そのまま投げてもエラーになる。

取得方法は

1.gidと474をXOR
2.36進数に変換
3.頭にoを付ける

とのことで、PHPだと

$worksheetId = 'o' . base_convert($gid ^ 474, 10, 36);

で動いた。

You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

コメントを残す

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

CAPTCHA