Sheetsu

 Sheetsu

Symfony Meetup #17 LT 資料
https://symfony.connpass.com/event/63659/

8e844e43f029ec38e206a464cf4587b3?s=128

Takashi Kanemoto

August 27, 2017
Tweet

Transcript

  1. Sheetsu #symfony_meetup 2017.08.27 @ttskch

  2. @ttskchʢ͖ͨͭͪʣ • ໊ݹ԰͔Βདྷ·ͨ͠ • ΧϧςοτίϛϡχέʔγϣϯζCTO • PHPྺ5.5೥ɺSymfonyྺ3೥ʢROMઐʣ • গ͚͓ͩ͠ख఻͍͠·ͨ͠

  3. Χϧςοτίϛϡχέʔγϣϯζ • ઈࢍPHPerେืूதʂ • ϦεςΟϯά޿ࠂӡ༻πʔϧʮLisketʯΛఏڙ • ࣌୅ΛઌऔΔϗϫΠτاۀͰ͢

  4. ΤϯδχΞͷಇ͖΍͢͞௒େࣄʹͯ͠·͢ Χϧςοτίϛϡχέʔγϣϯζ

  5. SNS͔ϝʔϧͰ͓ؾܰʹ͝࿈བྷ͍ͩ͘͞✨ Χϧςοτίϛϡχέʔγϣϯζ

  6. Sheetsu #symfony_meetup 2017.08.27 @ttskch

  7. sheetsu.com

  8. sheetsu.com

  9. sheetsu.com

  10. sheetsu.com

  11. sheetsu.com

  12. $client = new \GuzzleHttp\Client(); $client ->post('https://sheetsu.com/apis/v1.0/xxxxxxxxxxxx', [ 'json' => [

    'id' => 6, 'name' => 'ttskch', 'score' => 100, ], ]); sheetsu.com
  13. sheetsu.com

  14. ʘศརʂʂʂʗ

  15. ͱ͜Ζ͕͋Δ೔

  16. 402 Payment Required

  17. ͑ͬ

  18. None
  19. ͑ͬ

  20. None
  21. ͳΜ͔ແྉϓϥϯ͕ ͠Εͬͱͳ͘ͳͬͯͨ ʘ(^o^)ʗ

  22. ͱ͍͏Θ͚Ͱ

  23. ttskch/pheetsu

  24. ͷɺ࿩Λ͔ͨͬͨ͠ͷͰ͕͢

  25. ͷɺ࿩Λ͔ͨͬͨ͠ͷͰ͕͢

  26. ͷɺ࿩Λ͔ͨͬͨ͠ͷͰ͕͢

  27. ؒʹ߹͍·ͤΜͰͨ͠ ʘ(^o^)ʗ

  28. $pheetsu = \Ttskch\Pheetsu\Factory\PheetsuFactory::create( 'google_oauth2_client_id', 'google_oauth2_client_secret', 'google_oauth2_redirect_uri', 'google_oauth2_javascript_origin', 'spreadsheet_id', 'sheet_name' );

    $pheetsu->authenticate(); $pheetsu->create([ 'id' => 6, 'name' => 'ttskch', 'score' => 100, ]); Usageʢ༧ఆʣ
  29. σϞ͸ಈ͖·͢ʂʢreadͷΈʣ https://github.com/ttskch/pheetsu/tree/master/demo

  30. ׬੒ͨ͠Β ࢖ͬͯΈ͍ͯͩ͘͞

  31. ͓·͚

  32. ྻ൪߸ˠྻ໊ͷม׵͕ҙ֎ͱ೉͔ͬͨ͠ • ྫɿ3→Cɺ30→AD • ͸͍͸͍ɺ26ਐ਺Ͷ • ͭ

  33. $base26 = base_convert($number, 10, 26); $from = '0123456789abcdefghijklmnop'; $to =

    '0ABCDEFGHIJKLMNOPQRSTUVWXY'; $name = ''; foreach (str_split($base26) as $digit) { $digit = substr($to, strpos($from, $digit), 1); $name .= $digit; } echo $name . PHP_EOL; ྻ൪߸ˠྻ໊ͷม׵͕ҙ֎ͱ೉͔ͬͨ͠
  34. $number = 3; // -> C ྻ൪߸ˠྻ໊ͷม׵͕ҙ֎ͱ೉͔ͬͨ͠

  35. $number = 3; // -> C $number = 30; //

    -> AD ྻ൪߸ˠྻ໊ͷม׵͕ҙ֎ͱ೉͔ͬͨ͠
  36. $number = 3; // -> C $number = 30; //

    -> AD $number = 26; // -> A0 ͑ͬ ྻ൪߸ˠྻ໊ͷม׵͕ҙ֎ͱ೉͔ͬͨ͠
  37. $number = 3; // -> C $number = 30; //

    -> AD $number = 26; // -> A0 ͑ͬ // Z ʹͳͬͯ΄͔ͬͨ͠ͷʹ… ྻ൪߸ˠྻ໊ͷม׵͕ҙ֎ͱ೉͔ͬͨ͠
  38. $from = '0123456789abcdefghijklmnop'; $to = '0ABCDEFGHIJKLMNOPQRSTUVWXY'; ྻ൪߸ˠྻ໊ͷม׵͕ҙ֎ͱ೉͔ͬͨ͠

  39. $from = '0123456789abcdefghijklmnop'; $to = '0ABCDEFGHIJKLMNOPQRSTUVWXY'; ͋ͬɾɾɾʢ࡯͠ʣ ྻ൪߸ˠྻ໊ͷม׵͕ҙ֎ͱ೉͔ͬͨ͠

  40. Α͔ͬͨΒ಄ͷମૢʹ ղ͍ͯΈ͍ͯͩ͘͞

  41. ࣮૷ྫ https://github.com/ttskch/pheetsu/blob/ master/src/Service/ColumnNameResolver.php ΋ͬͱΤϨΨϯτͳղ๏͋ͬͨΒڭ͍͑ͯͩ͘͞

  42. Thanks :)