This file contains hidden or 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
<!doctype html> | |
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- CSRF Token --> | |
<meta name="csrf-token" content="{{ csrf_token() }}"> | |
<title>{{ config('app.name', 'Laravel') }}</title> |
This file contains hidden or 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
<template> | |
<div class="container"> | |
<p>sample</p> | |
</div> | |
</template> | |
<script> | |
export default { | |
data () { | |
return { |
This file contains hidden or 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
'use strict'; | |
const consumerKey = 'XXXXXXXXXXXXXXXXXX' | |
const consumerSecret = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' | |
const client = TwitterClient.getInstance(consumerKey, consumerSecret) | |
/** | |
* ①Twitterで作ったアプリに登録するための callbackUrl を取得する | |
* 実行後 『表示』→『ログ』でURLを確認してTwitterアプリに登録 |
This file contains hidden or 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
// audio要素作成 | |
const audio = document.createElement('audio') | |
// 音声ファイルを登録 | |
const source = audio.appendChild(document.createElement('source')) | |
source.setAttribute('src', '../sounds/default.mp3') | |
audio.appendChild(source) | |
document.body.appendChild(audio) | |
// 起動時以外のタイミングでplayを実行しないとエラーが起きるので関数を分けておく | |
function play () { |
This file contains hidden or 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
/** | |
いいね or RT 機能 | |
① 検索ワードをスプレッドシートから取得する | |
② 検索ワードをTwitterで検索する(たくさん取れてしまうので「直近10分間」の検索を10分毎に行う) | |
③ ツイートに いいね or RT をする | |
④ 他に検索ワードがあれば②に戻る | |
*/ | |
function main () { | |
// ① 検索ワードをスプレッドシートから取得する | |
var searchWords = pickUpSearchWords(); |
This file contains hidden or 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
function main () { | |
// 本来投稿文を取得する機能を応用する | |
const tweetURL = TwitterClient.pickUpTweetInOrder() | |
// URLからTweetIdを取得する | |
const tweetId = TwitterClient.convertFromUrlToTweetId(tweetURL) | |
// RTを行う | |
client.retweet([tweetId]) | |
} |
This file contains hidden or 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
const sheetData = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName); | |
const titleRow = 1; // 『投稿内容』とか書いている部分の行数 | |
const startRow = 1 + titleRow; // 1行目は『投稿内容』とか書いているので2行目から | |
const startCol = 1; | |
const endRow = sheetData.getLastRow() - titleRow; // 最後の行まで(2行目から始まっているので-1している) | |
const endCol = 2; // 『投稿回数』の列までなので2列目まで | |
// ① 投稿を一括で取得する | |
const cells = sheetData.getRange(startRow, startCol, endRow, endCol).getValues(); | |
This file contains hidden or 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
const startRow = 1 | |
const startCol = 1 | |
const endRow = sheetData.getLastRow() // 最終行 | |
const endCol = sheetData.getLastColumn() // 最終列 | |
// 悪い例 | |
for (let i = startRow; i <= endRow; i++) { | |
// 行数分getRangeとgetValueが実行される | |
const cell = sheetData.getRange(i, startCol, 1, endCol).getValue(); | |
// 実行する |
This file contains hidden or 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
// スプレッドシートのシートのデータを取得する(下記画像の赤、青まで) | |
const sheetName = 'シート1' | |
const sheetData = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName); | |
// 全てのセルのデータを取得する(下記画像の緑、オレンジまで) | |
const startRow = 1 | |
const startCol = 1 | |
const endRow = sheetData.getLastRow() | |
const endCol = sheetData.getLastColumn() | |
const cells = sheetData.getRange(startRow, startCol, endRow, endCol).getValues(); |