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
exports.handler = function (context, event, callback) { | |
/***** configuration *****/ | |
const phoneNumber = 'YOUR_PHONE_NUMBER'; | |
const timeout = event.Timeout || 12; | |
const secureRecordingLinks = false; | |
const voiceOpts = { |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Response> | |
<Message to="YOUR_PHONE_NUMBER"> | |
{{From}}: {{Body}} | |
</Message> | |
</Response> |
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
/* | |
* Copyright (c) 2011 by Twilio, Inc., all rights reserved. | |
* | |
* Use of this software is subject to the terms and conditions of | |
* the Twilio Terms of Service located at http://www.twilio.com/legal/tos | |
*/ | |
package com.twilio.ipmessaging.util; | |
import java.io.IOException; |
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
using System; | |
using Twilio; | |
using Twilio.Rest.Api.V2010.Account; | |
using Twilio.Types; | |
namespace Pamphlet | |
{ | |
internal static class Program | |
{ | |
private static void Main(string[] args) |
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
# cd to your project folder | |
# How much space is it using? | |
find . -type d -maxdepth 3 -name node_modules | xargs du -hcs | grep total | |
# Get rid of them | |
find . -type d -maxdepth 3 -name node_modules | xargs -p rm -rf # Will prompt before deleting. answer y/n |
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
import com.twilio.twiml.Body | |
import com.twilio.twiml.Message | |
import com.twilio.twiml.MessagingResponse | |
// ... | |
@RequestMapping(value = "/replyMessage", produces = arrayOf("text/xml")) | |
fun replyMessage(): String? { | |
val message = Message.Builder().body(Body("Be getting back to you soon, let me do some more Kotlin first")).build(); | |
return MessagingResponse.Builder().message(message).build().toXml(); | |
} |
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
import com.twilio.http.TwilioRestClient | |
import com.twilio.rest.api.v2010.account.MessageCreator | |
import com.twilio.type.PhoneNumber | |
// ... | |
@RequestMapping(value = "/sendMessage") | |
fun sendMessage(){ | |
val client = TwilioRestClient.Builder("YOUR_TWILIO_ACCOUNT_SID", "YOUR_TWILIO_AUTH_TOKEN").build() | |
val message = MessageCreator( |
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
package uk.co.placona.TwilioKotlin | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
@RestController | |
public class SMSController { | |
@RequestMapping(value = "/") | |
fun helloSpringBoot() = "Hello Spring Boot" | |
} |
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
package uk.co.placona.TwilioKotlin | |
import org.springframework.boot.SpringApplication | |
import org.springframework.boot.autoconfigure.SpringBootApplication | |
@SpringBootApplication | |
open class App | |
fun main(args: Array<String>) { | |
SpringApplication.run(App::class.java, *args) |
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
group 'uk.co.placona' | |
version '1.0-SNAPSHOT' | |
buildscript { | |
ext.kotlin_version = '1.1.1' | |
ext.spring_boot_version = '1.4.3.RELEASE' | |
repositories { | |
mavenCentral() | |
} |