Skip to content

Commit

Permalink
Merge pull request #181 from gruz0/feature/add-social-media-campaigns
Browse files Browse the repository at this point in the history
Generate a content for social media campaigns
  • Loading branch information
gruz0 authored Nov 23, 2024
2 parents 16769bf + b5607f8 commit 33b7d95
Show file tree
Hide file tree
Showing 21 changed files with 1,398 additions and 0 deletions.
42 changes: 42 additions & 0 deletions prompts/00-social-media-campaigns.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
You are a content creation expert.

Based on the following product description, target audience, value proposition, and social media campaign ideas, generate both short-form and long-form content suitable for various platforms.

Provide the content along with tips on how to adapt it for Twitter, LinkedIn, Facebook, Instagram, and general use.

For each piece of content, also provide a short image prompt that can be used to generate an accompanying image. The image prompt should be concise, descriptive, and suitable for the content and platform.

### Content Expectations

The **platform** field in your response must be in lowercase and must be one of the requested platforms only, without any extra social media platforms.
The **tips** field must have 3-5 items.

1. Short-Form Content

- Platforms: twitter, linkedin, facebook, instagram, general post.
- Content must be short, consisting of one paragraph (3-4 sentences).

2. Long-Form Content

- Platforms: linkedin, facebook, medium, blog post.
- Content must be concise, consisting of 2-3 paragraphs.

3. Video Content

- Platforms: youtube, instagram, youtube shorts.
- Script should contain up to 10 items or bullet points.

### Guidelines

- **Provide the Content Itself**: Generate the content following the length and format guidelines above.
- **Authentic and Conversational Tone**: Write the content in a natural, human-like manner that feels genuine and relatable to the reader.
- **Language**: Skip formal, sales-like language, and buzzwords such as: streamline, enhance, tailor, leverage, thrill, seamless, etc., in any form.
- **Provide Unique Insights**: Include specific examples, anecdotes, or lesser-known tips related to the product idea that offer real value and set the content apart from generic material.
- **Avoid Generic Statements**: Steer clear of vague or overused phrases; make the content specific to the product and audience.
- **Clarity and Conciseness**: Ensure the content is clear, concise, and to the point, avoiding unnecessary fluff or filler content.
- **Engaging and Interactive**: Incorporate elements that encourage reader engagement, such as questions, calls-to-action, or prompts for comments and shares.
- **Include a Header for Each Piece**: For each piece of content, include a header that explains what is inside and why it matters, using simple and friendly language without buzzwords or marketing jargon.
- **Specify the Platform**: Clearly indicate the platform the content is intended for.
- **Proofread and Polish**: Provide content that is free from grammatical errors and flows logically, enhancing readability.
- **Include Platform-Specific Tips**: Include tips on how to adapt or optimize the content for the specified platform.
- **Include Image Prompt**: For each piece of content, provide a short image prompt that describes an image suitable to accompany the content. The image prompt should be concise, vivid, and appropriate for the platform and audience.
25 changes: 25 additions & 0 deletions src/app/api/ideas/[id]/social_media_campaigns/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import * as Sentry from '@sentry/nextjs'
import { NextResponse } from 'next/server'
import { App } from '@/idea/service/Service'

export async function POST(_: Request, { params }: { params: { id: string } }) {
try {
await App.Commands.RequestSocialMediaCampaigns.handle({
ideaId: params.id,
})

return NextResponse.json(
{ success: true, message: 'Social media campaigns have been requested' },
{ status: 200 }
)
} catch (error) {
console.error('Error while requesting social media campaigns:', error)

Sentry.captureException(error)

return NextResponse.json(
{ error: 'Error while requesting social media campaigns.' },
{ status: 500 }
)
}
}
1 change: 1 addition & 0 deletions src/app/ideas/[id]/IdeaAnalysisReport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ export const IdeaAnalysisReport = ({ data }: Props) => {
<HorizontalLine />

<SectionContentIdeas
ideaId={data.id}
onReport={onReport}
data={data.contentIdeasForMarketing}
/>
Expand Down
30 changes: 30 additions & 0 deletions src/app/ideas/[id]/components/SectionContentIdeas.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client'

import Link from 'next/link'
import React, { useState } from 'react'
import FetchingDataMessage from '@/components/FetchingDataMessage'
import Paragraph from '@/components/Paragraph'
Expand All @@ -15,18 +16,22 @@ interface ContentIdeaProps {
}

interface SectionContentIdeasProps {
ideaId: string
onReport: (section: string) => void
data: Record<string, ContentIdeaProps> | null
}

interface ContentIdeaSectionProps {
ideaId: string
onReport: (section: string) => void
section: string
header: string
downloadableContent?: boolean
data: ContentIdeaProps
}

const SectionContentIdeas: React.FC<SectionContentIdeasProps> = ({
ideaId,
onReport,
data,
}) => {
Expand Down Expand Up @@ -54,69 +59,80 @@ const SectionContentIdeas: React.FC<SectionContentIdeasProps> = ({
{data ? (
<>
<ContentIdea
ideaId={ideaId}
header="Social Media Campaigns"
section="social_media_campaigns"
onReport={onReport}
data={data['socialMediaCampaigns']}
downloadableContent
/>

<ContentIdea
ideaId={ideaId}
header="Blogging and Guest Posts"
section="blogging_and_guest_posts"
onReport={onReport}
data={data['bloggingAndGuestPosts']}
/>

<ContentIdea
ideaId={ideaId}
header="Email Marketing"
section="email_marketing"
onReport={onReport}
data={data['emailMarketing']}
/>

<ContentIdea
ideaId={ideaId}
header="Surveys & Polls"
section="surveys_and_polls"
onReport={onReport}
data={data['surveysAndPolls']}
/>

<ContentIdea
ideaId={ideaId}
header="Video Content"
section="video_content"
onReport={onReport}
data={data['videoContent']}
/>

<ContentIdea
ideaId={ideaId}
header="Infographics and Visual Content"
section="infographics_and_visual_content"
onReport={onReport}
data={data['infographicsAndVisualContent']}
/>

<ContentIdea
ideaId={ideaId}
header="Community Engagement"
section="community_engagement"
onReport={onReport}
data={data['communityEngagement']}
/>

<ContentIdea
ideaId={ideaId}
header="Paid Advertising"
section="paid_advertising"
onReport={onReport}
data={data['paidAdvertising']}
/>

<ContentIdea
ideaId={ideaId}
header="Webinars & Live Streams"
section="webinars_and_live_streams"
onReport={onReport}
data={data['webinarsAndLiveStreams']}
/>

<ContentIdea
ideaId={ideaId}
header="Partnerships & Collaborations"
section="partnerships_and_collaborations"
onReport={onReport}
Expand All @@ -133,10 +149,12 @@ const SectionContentIdeas: React.FC<SectionContentIdeasProps> = ({
}

const ContentIdea: React.FC<ContentIdeaSectionProps> = ({
ideaId,
onReport,
section,
header,
data,
downloadableContent = false,
}) => (
<Section
header={header}
Expand Down Expand Up @@ -166,6 +184,18 @@ const ContentIdea: React.FC<ContentIdeaSectionProps> = ({
</li>
))}
</ul>

{downloadableContent && (
<div className="mb-2">
<Link
href={`/ideas/${ideaId}/${section}`}
target="_blank"
className="rounded bg-blue-600 px-4 py-2 font-semibold text-white hover:bg-blue-700"
>
Generate Content
</Link>
</div>
)}
</div>
</Section>
)
Expand Down
Loading

0 comments on commit 33b7d95

Please sign in to comment.