├── README.md
└── static
└── hackathon-how-to.png
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | ## Table of Contents
4 | * [Why does Twilio sponsor hackathons](README.md#why-does-twilio-sponsor-hackathons)
5 | * [TODO before the hackathon](README.md#TODO-before-the-hackathon)
6 | * [TODO after the hackathon](README.md#TODO-after-the-hackathon)
7 | * [Quick-and-easy code snippets](README.md#quick-and-easy-code-snippets)
8 | * [Tutorials](README.md#tutorials)
9 | * [Tutorials by product](README.md#by-product)
10 | * [Tutorials by language](README.md#by-language)
11 | * [Node.js Tutorials](README.md#nodejs)
12 | * [React.js Tutorials](README.md#nodejs)
13 | * [Python Tutorials](README.md#python)
14 | * [Swift Tutorials](README.md#swift)
15 | * [Java Tutorials](README.md#java)
16 | * [YouTube videos](README.md#youtube-videos)
17 | * [Some cool hacks we've seen from hackathons](README.md#some-cool-hacks-weve-seen-from-hackathons)
18 | * [Tips](README.md#tips)
19 |
20 | ## Why does Twilio sponsor hackathons?
21 | - To inspire and equip developers, mentoring and teaching you about Twilio as well as general programming topics unrelated to Twilio products!
22 | - To create evangelists, champions out of developers by getting you excited to use Twilio!
23 | - Receive product feedback and see different use cases. Be creative! :D
24 | - Yes, to generate more sign-ups. We are a public company after all!
25 | - Yes, it does look good in a Twilio interview to "eat the API dog food" and have experience using Twilio products--so use Twilio in your hacks and you can talk about it in interviews. Some former "Best use of Twilio" hackathon winners went on to intern here! Check out our [job listings](https://twilio.com/jobs)
26 |
27 | ## TODO before the hackathon
28 | We recommend playing through [TwilioQuest](https://twilio.com/quest), a video game that makes it fun to learn how to use different Twilio products. There's also lots of tutorials and documentation you can read through (see below.)
29 |
30 | ## TODO after the hackathon
31 | Make sure to put your hack on GitHub (public) for the world to see and submit to DevPost! This will come in handy for interviews and more.
32 | Go back and clean up the code, make a good README, and continue iterating over your hack if you are passionate about it and want to add on different features. The sky is the limit!
33 |
34 | ## Get started
35 | 1. [Make a Twilio account (it's free!)](https://www.twilio.com/try-twilio)
36 | 2. [Apply promo code](https://twil.io/apply-promo)
37 | 3. [Buy a Twilio phone number](https://www.twilio.com/console/phone-numbers/incoming)
38 | 4. Configure your Twilio phone number for when a SMS or phone call comes in with a [TwiML Bin](https://www.twilio.com/console/twiml-bins), [Twilio Function](https://www.twilio.com/console/functions), or [ngrok](https://ngrok.io) URL.
39 |
40 | ## Quick and easy code snippets
41 | Did you miss the Twilio demo during the hackathon Opening Ceremony? It probably contained code like this:
42 |
43 | ### Node.js code to respond to texts
44 | ```js
45 | var express = require('express');
46 | var bodyParser = require('body-parser');
47 | var dotenv = require('dotenv');
48 | dotenv.load();
49 |
50 | var app = express();
51 | app.use(bodyParser.urlencoded({extended: false}));
52 | app.post('/hack', (req, res) => {
53 | var inbMsg = req.body.Body.toLowerCase().trim();
54 | if(inbMsg == "matcha") {
55 | res.send("Responding to matcha");
56 | }
57 | res.send("Else respond with this");
58 | });
59 |
60 | app.listen(1337, () => {
61 | console.log("Express server listening on port 1337");
62 | });
63 | ```
64 |
65 | ### Node.js code to make a phone call to every number that texted your Twilio number
66 | ```js
67 | var express = require('express');
68 | var bodyParser = require('body-parser');
69 | var dotenv = require('dotenv');
70 | dotenv.load();
71 | var fromNum = "your-twilio-number";
72 |
73 | var app = express();
74 | app.use(bodyParser.urlencoded({extended: false}));
75 | const client = require('twilio')('YOUR-ACCOUNT-SID', 'YOUR-AUTH-TOKEN');
76 | const filter = {
77 | to: fromNum // switch this out with your "from" number
78 | }
79 | client.messages.each(filter, (message) => client.calls.create({
80 | url: 'https://desolate-shelf-95000.herokuapp.com/redirect', // switch this for the mp3 of your choice
81 | to: message.from,
82 | from: fromNum // again, switch out for your "from" number
83 | }).then(call => console.log(call.sid)));
84 | ```
85 |
86 | ### Node.js code in a [Twilio Function](https://twilio.com/console/functions)
87 | ```js
88 | exports.handler = function(context, event, callback) {
89 | let twiml = new Twilio.twiml.MessagingResponse();
90 | if(event.Body.toLowerCase().trim() == "matcha") {
91 | twiml.message("You right. @lizziepika, lsiegle@twilio.com, promo: HACKUCI2020, https://twil.io/hackathons");
92 | }
93 | else {
94 | twiml.message("No. @lizziepika, lsiegle@twilio.com, promo: HACKUCI2020, https://twil.io/hackathons");
95 | }
96 | callback(null, twiml);
97 | };
98 | ```
99 |
100 | ### Python code to respond to texts
101 | ```python
102 | from twilio.twiml.messaging_response import MessagingResponse
103 | from flask import Flask, request
104 |
105 | app = Flask(__name__)
106 | @app.route('/sms', methods=['GET', 'POST'])
107 | def sms():
108 | msg = request.values.get('Body').lower().strip()
109 | res = MessagingResponse()
110 | if msg == "matcha":
111 | res.message("noice")
112 | else:
113 | res.message("meh")
114 | return str(res)
115 |
116 | if __name__ == "__main__":
117 | app.run(debug=True)
118 | ```
119 | ### Python code to make a phone call to every number that texted your Twilio number
120 | ```python
121 | from twilio.rest import Client
122 |
123 | client = Client('YOUR-TWILIO-ACCOUNT-SID', 'YOUR-TWILIO-AUTH-TOKEN')
124 | for num in client.messages.list(to='YOUR-TWILIO-NUMBER'):
125 | call = client.calls.create(
126 | url = 'http://demo.twilio.com/docs/classic.mp3',
127 | to = num.from_,
128 | from_ = 'YOUR-TWILIO-NUMBER'
129 | )
130 | print(call.sid)
131 | ```
132 | ## Tutorials
133 | ### by product
134 | - [SMS docs](https://www.twilio.com/docs/sms)
135 | - [Voice docs](https://www.twilio.com/docs/voice)
136 | - [Video tutorials](https://www.twilio.com/docs/video/tutorials)
137 | - [Autopilot blog posts](https://www.twilio.com/docs/autopilot/blog-posts)
138 |
139 | ### by language
140 | #### Node.js
141 | - [send sms and mms in Node.js](https://www.twilio.com/docs/sms/tutorials/how-to-send-sms-messages-node-js)
142 | - [SMS Node.js quickstart](https://www.twilio.com/docs/sms/quickstart/node)
143 | - [Voice Node.js quickstart](https://www.twilio.com/docs/voice/quickstart/node)
144 | - [Video quickstart for JS](https://github.com/twilio/video-quickstart-js)
145 |
146 | #### React.js
147 | - [Send an SMS from React with Twilio](https://www.twilio.com/blog/send-an-sms-react-twilio)
148 |
149 | #### Python
150 | - [send SMS and MMS in Python](https://www.twilio.com/docs/sms/tutorials/how-to-send-sms-messages-python)
151 | - [SMS Python quickstart](https://www.twilio.com/docs/sms/quickstart/python)
152 | - [Voice Python quickstart](https://www.twilio.com/docs/voice/quickstart/node)
153 |
154 | #### Swift
155 | - [chat in Swift](https://www.twilio.com/docs/chat/tutorials/chat-application-ios-swift)
156 | - [SMS in Swift](https://www.twilio.com/blog/2018/03/sending-text-messages-in-swift-with-twilio.html)
157 | - [iOS quickstart](https://www.twilio.com/docs/chat/ios/quickstart)
158 |
159 | #### Java
160 | - [Android quickstart](https://www.twilio.com/docs/voice/client/android/quickstart/php)
161 | - [Twilio Java library](https://github.com/twilio/twilio-java)
162 | - [Java SMS quickstart](https://www.twilio.com/docs/sms/quickstart/java)
163 | - [send SMS, MMS in Java](https://www.twilio.com/docs/sms/tutorials/how-to-send-sms-messages-java)
164 | - [receive, reply to SMS, MMS in Java](https://www.twilio.com/docs/sms/tutorials/how-to-receive-and-reply-java)
165 | - [voice quickstart in Java](https://www.twilio.com/docs/voice/quickstart/java)
166 | - [respond to incoming phone calls in Java](https://www.twilio.com/docs/voice/tutorials/how-to-respond-to-incoming-phone-calls-java)
167 | - [modify in-progress calls in Java](https://www.twilio.com/docs/voice/tutorials/how-to-modify-calls-in-progress-java)
168 | - [make outbound calls in Java](https://www.twilio.com/docs/voice/tutorials/how-to-make-outbound-phone-calls-java)
169 | - [Chat tutorial for Android and Java](https://www.twilio.com/docs/chat/tutorials/chat-application-android-java)
170 | - [Twilio Video quickstart for Android](https://github.com/twilio/video-quickstart-android)
171 |
172 | #### YouTube videos
173 | - [Build an IVR with Twilio Studio](https://www.youtube.com/watch?v=GifYSpB-EU4)
174 | - [Make + receive phone calls in Node.js](https://www.youtube.com/watch?v=CgNd6VgNzDk)
175 | - [Send + receive SMS in Node.js](https://www.youtube.com/watch?v=f9jE5ywz8cs)
176 | - [Send + receive SMS in Python](https://www.youtube.com/watch?v=knxlmCVFAZI)
177 | - [Make + receive phone calls in Python](https://www.youtube.com/watch?v=-AChTCBoTUM)
178 | - [Send + reply to SMS in Java 8 and Spark](https://www.youtube.com/watch?v=jdlWQtgsNSU)
179 | - [Send email with Java and SendGrid](https://www.youtube.com/watch?v=06M3lZzZEMY&list=PLqrz4nXepkz5IpQFH81FcvknWgnKf50DH&index=30)
180 | - [Send email with Python and SendGrid](https://www.youtube.com/watch?v=xCCYmOeubRE&list=PLqrz4nXepkz5IpQFH81FcvknWgnKf50DH&index=29)
181 | - [Send a WhatsApp Message in Python](https://www.youtube.com/watch?v=98OewpG8-yw&list=PLqrz4nXepkz5IpQFH81FcvknWgnKf50DH&index=27)
182 | - [Send a WhatsApp message in Node.js](https://www.youtube.com/watch?v=PxphXQmtHLo&list=PLqrz4nXepkz5IpQFH81FcvknWgnKf50DH&index=25)
183 | - [Send an SMS in Kotlin](https://www.youtube.com/watch?v=uThgVuAEKgU&list=PLqrz4nXepkz5IpQFH81FcvknWgnKf50DH&index=18)
184 | - [Image recognition in Python with Clarifai and Twilio MMS](https://www.youtube.com/watch?v=18KQIPhiVdc)
185 | - [Basics of making + receiving phone calls](https://www.youtube.com/watch?v=Yf9JkKmeO8U)
186 | - [Basics of sending + receiving text messages](https://www.youtube.com/watch?v=344S512CoP0)
187 | - [Send and reply to text messages in Java](https://www.youtube.com/watch?v=jdlWQtgsNSU)
188 | - [Build SMS surveys in Twilio Studio](https://www.youtube.com/watch?v=iTZRooIdy6U)
189 | - [Build call forwarding apps with Twilio Studio](https://www.youtube.com/watch?v=atshc8I-AjA)
190 | - [How to post messages to Slack with Twilio Studio](https://www.youtube.com/watch?v=wMExZ3yq3Vk)
191 |
192 | ## Some cool hacks we've seen from hackathons
193 | - [smtex from MHacks 11](https://devpost.com/software/smtex)
194 | - [Moist Meter from MHacks 11](https://devpost.com/software/moist-meter)
195 |
196 |
197 |
198 | - [Health Hunt AR from TreeHacks 2019](https://devpost.com/software/healthhunt-ar)
199 |
200 |
201 |
202 | ## Tips
203 | We've been to a lot of hackathons, both as hackers and sponsors. What advice do we have for you as hackers?
204 | - **Have fun!** Hackathons can be intense and a lot to handle. Don't forget to build something you want to build.
205 | - **Take risks!** Learn something new. Try building something in a new language. You're surrounded by passionate people who are giving up their weekends to build something or help you. Take advantage of them! Ask questions about what classes they're taking if they're a fellow hacker, or talk to a mentor/sponsor about their jobs and their backgrounds.
206 | - **Go to workshops and activities.** Yes, you're probably here to hack, but you can't be productive for the whole time. Don't forget to take breaks, talk to people, and take advantage of what the organizers have put together for you.
207 | - **Demo.** Even if your hack isn't perfect, it's a hack. You had a weekend to build something and hopefully you did other things, too (maybe cup-stacking?) Prepare a demo and give it! It's fun and important to be able to explain what you did and to show others.
208 | - On the topic of demos, keep it short and simple. Yes, it's nice to have a lead-in showing you did background research, but the focus should be on showing what you built. That is the primary focus of judges: most everything else is probably secondary.
209 |
--------------------------------------------------------------------------------
/static/hackathon-how-to.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/twilio/hackathons/437d35a42d00f869f2d05875a1c850519ab30254/static/hackathon-how-to.png
--------------------------------------------------------------------------------