Skip to content

Instantly share code, notes, and snippets.

View hunnycode's full-sized avatar

joohoun song hunnycode

View GitHub Profile
@hunnycode
hunnycode / incomming-jp.xml
Last active June 8, 2023 07:01
Twilio動詞 <Say>に「language="ja-jp"」オプションを入れれば日本語のテキスト音声合成ができる。
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say language="ja-jp">Twilioへようこそ!</Say>
</Response>
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say language="ja-jp">こんにちは</Say>
</Response>
<?php
$numbers = array("<number to call n>", "<number to call n>", "<number to call n>");
$number_index = isset($_REQUEST['number_index']) ? $_REQUEST['number_index'] : "0";
$DialCallStatus = isset($_POST['DialCallStatus']) ? $_POST['DialCallStatus'] : "";
header("content-type: text/xml");
if($DialCallStatus!="completed" && $number_index == 2){
$number_index = 0;
}
<?php
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library
// Substitute the following values using the details from your Twilio Account
$accountSid = ACCOUNT_SID;
$apiKeySid = API_KEY_SID;
$apiKeySecret = API_KEY_SECRET;
$configurationProfileSid = CONFIGURATION_PROFILE_SID;
// Create an Access Token
@hunnycode
hunnycode / CreateTable
Last active May 13, 2016 09:27
【ハンズオン】Node-RED入門編 ref: http://qiita.com/joohounsong/items/5b5241df84f910df6627
CREATE TABLE "TWEETS"
(
"TWEETID" VARCHAR(50),
"SENTIMENT" INT
);
@hunnycode
hunnycode / hello.js
Last active May 11, 2016 05:12
【ハンズオン資料】IBM Bluemix OpenWhisk もくもく会 ref: http://qiita.com/joohounsong/items/ba4657549138b2fc47ba
function main(params) {
return {payload: 'Hello, ' + params.name + ' from ' + params.place};
}
<?php
$to = $_POST['email'];
$from = "送信元メールアドレス";
$subject = $_POST['subject'];
$body = $_POST['body'];
$url = 'https://api.sendgrid.com/';
$user = 'SendGrid username';
$pass = 'SendGrid Password';
<!DOCTYPE html>
<html>
<head>
<title>PHP Starter Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="style.css" />
</head>
<body>
<table>
<tr>
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems' # This line not needed for ruby > 1.8
require 'twilio-ruby'
# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'your master account sid'
auth_token = 'your master account auth token'
@client = Twilio::REST::Client.new account_sid, auth_token
# Get an object from its sid. If you do not have a sid,
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems' # This line not needed for ruby > 1.8
require 'twilio-ruby'
# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'your account sid'
auth_token = 'your auth token'
@client = Twilio::REST::Client.new account_sid, auth_token