Copy Generator

While taking Harvard’s CS50x, I was also working as a marketing intern for Primo Artists, a classical music artist management company. I created Copy Generator, a collaborative tool, to help both myself and my coworkers automate the process of tagging profiles on Instagram, Threads, Facebook, and X (Twitter) with proper formatting and signature Primo style guidelines. I originally developed Copy Generator using Google Sheets and Apps Script (JavaScript) and later developed a web app version using Flask (Python), SQLite, HTML, CSS, and Javascript.

“Copy” is a professional term for social media captions, and under Primo Artists this term refers to a specific organization of captions for 4 different social media platforms, allowing for quick peer editing and posting.

Primo Artists posts every day, and each post is shared across all 4 platforms. We were tagging the same 20-30 profiles in the majority of our posts, so I found myself searching for the same profile tags again and again. If we noticed a typo or decided to make a chance, we would go through and edit each caption for the 4 platforms individually. In this process of manually editing, it was easy to overlook small typos.

On top of that, each platform has its own unique quirks and Primo Artists has subtle formatting guidelines that can be easy to overlook: If the first word in a tweet is someone’s handle (starting with @), it’s a “reply” tweet and not visible in timelines of people who don’t follow both accounts. We would add an emoji to the beginning of the tweet in these cases. Primo likes to use curly quotes (“ ‘) instead of straight quotes (" '). The order of hashtags is important, as Primo places their artists’ hashtags first and general tags (e.g. #classicalmusic) last. Using Bit.ly links instead of standard links, we can save character space and direct users to important info/events (for all platforms other than Instagram, which doesn’t support links). And many, many more… The Primo Artists intern program lasts only ~3 months. To become familiar and consistent with these rules in that timeframe can be challenging.

With all of these subtle rules and the redundant tagging process, I saw an opportunity to automate this work to help myself, my peers, and future interns.

A graphic and caption I created announcing artists’ performances during the 2023-24 Carnegie Hall season. A post made early in my internship, it took a few revisions before I got the formatting correct.

The solution I landed on was Copy Generator, a software tool that takes in plain text input and returns copy formatted and with profiles tagged for all platforms.

Google Sheets Version:

The Google Sheets Copy Generator uses two tables. The “Copy Generator” table is a simple UI with a place to type plain text captions and a place to copy the tagged, formatted caption once generated. The “Database” table contains the names, social media tags, hashtags, and other information for each person/venue/organization Primo tags in its posts.

A JavaScript funciton written in Google’s Apps Script named replaceArtistTags returns a value to the generated copy cell of the “Copy Generator” table. This function takes in the plain text caption, the database, the current number of database items, and a Bit.ly access token and group ID (two values needed to use the Bit.ly API) and returns formatted and tagged captions for each social media site and an ordered list of hashtags. Using string manipulation, regular expressions, and calls to the Bit.ly API, the function does the following automatically:

  • Searches the plain text copy for any names that also exist in the Database table. The function finds and replaces the first occurrence of profile names with the proper tags for all platforms. If the profile does not exist for any platform, the generator preserves the plain text name.

  • When a name is found, the hashtags associated with that name are also added to the copy.

  • Hashtags are automatically sorted and duplicates removed.

  • Replaces straight quotes (" or ') with curly quotes.

  • Adds emoji to TW when first character is a tag (the emoji can be customized for each profile in the Database).

  • Detects any links starting with https:// or http:// and automatically converts to Bit.ly links for all platforms except Instagram, where links are not clickable.

I was drawn to Google Sheets because of its collaborative potential: any user could add a profile to the database, and once added, that profile could be used by anyone, anytime. All server and data hosting would be managed by Google rather than Primo employees, which was perfect for ensuring this tool would be easy to continue using after my internship ended. After just a week of use, we had collectively added ~200 profiles that we no longer had to search for manually. My peers and I found ourselves writing and editing captions quicker with less errors and the convenience of having everything in one place.

Web App Version:

The Google Sheets version had a few areas for improvement:

  1. The features were limited by what is possible in Google Sheets and Apps Script. For example, functions could only return to their respective cells and take arguments from other cells. I also couldn’t import any libraries.

  2. It is easy to make a typo in the Google Sheets database or accidentally delete a cell, breaking the generator. Creating a dedicated web app makes it easy to streamline the UI for its specific needs, making the Copy Generator more user friendly and less intimidating at a first glance.

  3. Google Sheets is automatically collaborative, which is great for the database, though sometimes people end up stepping on each others’ toes when writing captions. It is always possible to add more Copy Boxes as needed, but doing so looks a bit clunky. In the web app, each user has their own personal session.

Using the Flask framework in Python, a SQLite database to hold all artist info, and HTML, CSS with Bootstrap, and JavaScript, I was able to create a custom Copy Generator web app. This version has all the same features as the Google Sheets with a main Copy Generator UI page and a Database page, but with a tailored interface and features and conveniences that weren’t possible in Google Sheets. For example, you can click the box of the generated copy to copy it to your clipboard!

Streamlined Copy Generator UI and click to copy to clipboard! Caption generates much faster than Google Sheets version.

Custom table is easy to read and tailored to Copy Generator needs. New rows can be added and deleted from the DOM dynamically and are added to SQLite in the background. Automatically sorts on refresh.

I gained an incredible amount of experience working on this project, and found it fulfilling to use code to solve real world problems and help my peers. Thank you to Primo Artists interns and employees for encouraging me and providing suggestions throughout the development process!

Previous
Previous

Contemporary Classical Composition

Next
Next

Go - Python