Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now
Build the future of communications.
Start building for free
  • By Sam Agnew
    Generating Lyrics in the Style of your Favorite Artist with Python, OpenAI's GPT-3 and Twilio SMS Copy of Generic Blog Header 4(3).png

    With concerts canceled and many artists being unable to release new music, people around the world are missing their favorite bands. What if you could fill that void by bringing any band or artist's lyrical style home with Python code to generate new songs?

    Try texting the name of your favorite artist to +1 (315) 65-LYRICS (+1 315 659-7427) or +44 7401 193427 if you're in the UK to get lyrics in their style, and continue reading to find out how to program this yourself!

    Computer-generated Black Sabbath lyrics

    OpenAI's new GPT-3 (Generative Pre-trained Transformer 3) model was trained on a massive corpus of text making it incredibly powerful. This can be used to generate song lyrics in the style of any artist with surprisingly little input text given to it as a prompt.

    Let's walk through how to create a text-message powered bot to generate song lyrics in Python using Twilio Programmable …

    Read More
  • By Sam Agnew
    Building a Punk Lyrics Bot in Python with OpenAI's GPT-3 and Twilio SMS Copy of Generic Blog Header 1(2).png

    In the midst of pandemic-related lockdowns, many people around the world miss seeing their favorite bands. What if you could bring the anti-authoritarian, do-it-yourself ethos of punk rock home in the form of new song lyrics created by your Python code?

    OpenAI's new GPT-3 (Generative Pre-trained Transformer 3) model was trained on a massive corpus of text making it incredibly powerful. This can be used to generate song lyrics with surprisingly little input text given to it as a prompt.

    Let's walk through how to create a text-message powered bot to write Punk songs in Python using Twilio Programmable Messaging and OpenAI's API for GPT-3.

    STAGE DIVE

    Before moving on, you'll need the following:

    • Python 3.6 or newer. If your operating system does not provide a Python interpreter, you can go to python.org to download an installer.
    • A virtual environment enabled before installing any Python libraries.
    • A Twilio account and a …
    Read More
  • By Sam Agnew
    Automated Yugioh Deckbuilding in Python with OpenAI's GPT-3 and Twilio SMS Copy of Generic Blog Header 1(1).png

    Coming up with a deck in any trading card game is often very difficult, and takes a lot of thought and experimentation. What if we could just have a computer do it for us?

    OpenAI's new GPT-3 (Generative Pre-trained Transformer 3) model was trained on a massive corpus of text making it incredibly powerful. This can be used to generate something similar to pretty much any text found on the internet, including in our case Yugioh deck lists.

    Let's walk through how to create a text-message powered bot to generate Yugioh deck lists in Python using Twilio Programmable Messaging and OpenAI's API for GPT-3.

    EXODIA THE FORBIDDEN ONE

     

    Before moving on, you'll need the following:

    • Python 3.6 or newer. If your operating system does not provide a Python interpreter, you can go to python.org to download an installer.
    • A virtual environment enabled before installing any Python libraries.
    • A Twilio account and a Twilio …
    Read More
  • By Sam Agnew
    Generating Yugioh Fan Fiction with OpenAI's GPT-3 and Twilio SMS Copy of Generic Blog Header 4(2).png

    Fans of all types of media often have fun coming up with alternate stories that take place in the universe of their favorite pieces of fiction. Sometimes, particularly talented writers or artists working on fan fiction even end up being selected to work professionally on the licensed material.

    OpenAI's new GPT-3 (Generative Pre-trained Transformer 3) model was trained on a massive corpus of text making it incredibly powerful. This can be used to generate full dialogue between characters with surprisingly little input text given to it as a prompt.

    Let's walk through how to create a text-message powered bot to generate fan fiction in Python using Twilio Programmable Messaging and OpenAI's API for GPT-3. During quarantine, I've spent a lot of time listening to the soundtrack for Yugioh! The Eternal Duelist Soul because it is great coding music, so let's use the ridiculous universe of the Yugioh anime …

    Read More
  • By Sam Agnew
    Generating Dragon Ball Fan Fiction with OpenAI's GPT-3 and Twilio SMS Copy of Generic Blog Header 3(2).png

    Fans of all types of media often have fun coming up with alternate stories that take place in the universe of their favorite pieces of fiction. Sometimes, particularly talented writers or artists working on fan fiction even end up being selected to work professionally on the licensed material.

    OpenAI's new GPT-3 (Generative Pre-trained Transformer 3) model was trained on a massive corpus of text making it incredibly powerful. This can be used to generate full dialogue between characters with surprisingly little input text given to it as a prompt.

    Let's walk through how to create a text-message powered bot to generate fan fiction in Python using Twilio Programmable Messaging and OpenAI's API for GPT-3. We'll use the Dragon Ball universe as an example because I had a lot of fun watching the series through my childhood to my adulthood.

    Before moving on, you'll need the following:

    • Python 3.6 …
    Read More
  • By Sam Agnew
    Retrieving Twilio MMS Image URLs with Node.js Copy of Generic Blog Header 4(1).png

    When working with Twilio MMS, you often need to access a URL to the pictures contained in a message. Typically when the message is initially received, the webhook request that Twilio sends to your application will contain MediaUrl properties that you can use directly in your application. But if you want to use the REST API to access a URL to an image contained in a Message Resource, you need to do a little more work, as the only option available to you is the uri of the Media resource:

    message.media().list().then(media => {
      media.forEach(m => {
        const url = 'https://api.twilio.com' + m.uri.replace('.json', '');
        console.log(url);
      });
    });
    

    Let's walk through a …

    Read More
  • By Sam Agnew
    Retrieving Twilio MMS Image URLs in Python Copy of Generic Blog Header 4.png

    When working with Twilio MMS, you often need to access a URL to the pictures contained in a message. Typically when the message is initially received, the webhook request that Twilio sends to your application will contain MediaUrl properties that you can use directly in your application. But if you want to use the REST API to access a URL to an image contained in a Message Resource, you need to do a little more work, as the only option available to you is the uri of the Media resource:

    if int(message.num_media) > 0:
        for media in message.media.list():
            media_url = 'https://api.twilio.com' + media.uri[:-5] # Strip off the '.json'
            print(media_url)
    

    Let's wa …

    Read More
  • By Sam Agnew
    How to Write Lua Scripts for Video Games with the BizHawk Emulator Copy of Generic Blog Header 1.png

    BizHawk is a multi-system emulator beloved by the Tool Assisted Speedrun community for its recording/playback and debugging tools, as well as Lua scripting functionality that can be used for a variety of purposes.

    While there is basic documentation describing some of the functions available in these scripts, the lack of working code samples might make it difficult for some to get started. Let's walk through some of the Lua scripting features the BizHawk emulator provides, and have some fun with real examples.

    Setting up the BizHawk emulator

    BizHawk runs on multiple operating systems, but Lua scripting is only available on the Windows versions. If you are on Mac or Linux, you can use Wine, although setup might be a bit of an involved process depending on which version of which operating system you're using.

    There are installation instructions in the README of the project's repository, including an installer …

    Read More
  • By Sam Agnew
    Building a Land Acknowledgement Text Line with Node.js, Twilio, and Puppeteer Copy of Generic Blog Header 3.png

    In the age of impending climate catastrophe, it is important now more than ever to respect the rights and sovereignty of Native people worldwide. Recognizing the traditional stewards of the land by making land acknowledgements at events or gatherings is a vital first step towards inserting an awareness of Indigenous presence and land rights into everyday life.

    This kind of thing has been becoming a bit more commonplace at developer conferences such as JSConf US and PyCascades.

    PyCascades Land Acknowledgment

    Using Native Land Digital, an Indigenous-led, in-progress project dedicated to helping people learn more about their local traditional Indigenous territories, I created a text messaging bot for people who are on the go to quickly find out which Native territory a given address exists on.

    Try it by texting an address to +1 (331) 244-LAND (+1 331 244 5263).

    By texting "101 Spear Street" for example, we can see that …

    Read More
  • By Sam Agnew
    4 Tools for Web Scraping in Node.js Copy of Generic Blog Header 3 (2).png

    Sometimes the data you need is available online, but not through a dedicated REST API. Luckily for JavaScript developers, there are a variety of tools available in Node.js for scraping and parsing data directly from websites to use in your projects and applications.

    Let's walk through 4 of these libraries to see how they work and how they compare to each other.

    Make sure you have up to date versions of Node.js (at least 12.0.0) and npm installed on your machine. Run the terminal command in the directory where you want your code to live:

    npm init --yes
    

    For some of these applications, we'll be using the Got library for making HTTP requests, so install that with this command in the same directory:

    npm install got@11.0.2
    

    Let's try finding all of the links to unique MIDI files on this web page from the Video Game Music Archive with a …

    Read More
  • Newer
    Older
    Sign up and start building
    Not ready yet? Talk to an expert.