<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: nightly</title>
    <description>The latest articles on DEV Community by nightly (@nightlyinks).</description>
    <link>https://dev.to/nightlyinks</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2164604%2Fa266594b-6afe-4148-a864-7ebceab9b700.jpeg</url>
      <title>DEV Community: nightly</title>
      <link>https://dev.to/nightlyinks</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nightlyinks"/>
    <language>en</language>
    <item>
      <title>Pinata OG! | Generate beautiful OpenGraph Images with Pinata File API</title>
      <dc:creator>nightly</dc:creator>
      <pubDate>Mon, 14 Oct 2024 05:40:58 +0000</pubDate>
      <link>https://dev.to/nightlyinks/pinata-og-generate-beautiful-opengraph-images-with-pinata-file-api-2mmp</link>
      <guid>https://dev.to/nightlyinks/pinata-og-generate-beautiful-opengraph-images-with-pinata-file-api-2mmp</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/pinata"&gt;The Pinata Challenge &lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built | Pinata OG
&lt;/h2&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://pinata.nightly.ink/" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpinata.nightly.ink%2Fapi%2Fget-og%3Fcid%3Dbafybeif4gfptwk3ef6oy5lyh62o2itcln6e72yrl57zzsrakslas4mgiwy" height="420" class="m-0" width="800"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://pinata.nightly.ink/" rel="noopener noreferrer" class="c-link"&gt;
          Pinata OG!
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          Generate beautiful OG Images with Pinata File API!
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpinata.nightly.ink%2Ffavicon.ico" width="800" height="400"&gt;
        pinata.nightly.ink
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Ever found yourself pulling your hair out over OpenGraph (OG) Images? Wait, what's an OG Image, you ask? It's the secret sauce that turns your boring links into eye-catching masterpieces when you share them on social media! Picture this: your link, strutting its stuff on platforms like a digital runway model. Trust me, a sizzling OG Image is the difference between "meh" and "click me now!"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9v1nrhi5c87n7g504n1f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9v1nrhi5c87n7g504n1f.png" alt="Discord Link OG Image Embed" width="559" height="408"&gt;&lt;/a&gt;&lt;br&gt;
Feast your eyes on this beauty! ☝️ That, my friends, is the power of a well-crafted OG Image in action.&lt;/p&gt;

&lt;p&gt;Tired of your links being wallflowers at the social media party? Fear not! I've built a platform that would let you generate gorgeous OpenGraph Images With just a few clicks, and you'll be pumping out drop-dead gorgeous OpenGraph Images for your sites in seconds!&lt;/p&gt;

&lt;p&gt;Here's the deal: edit some fields, sprinkle your magic on it, and voilà! Your OG Image is ready to rock. But wait, there's more! We'll even generate those pesky metadata tags for you. Just copy, paste them into your &lt;code&gt;&amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;/code&gt; component, and you're good to go! It's so simple even your grandmother could do it!&lt;/p&gt;

&lt;p&gt;So, ready to give your links a glow-up and watch those click rates soar? Let's make your content pop!&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;This is me dog fooding Pinata OG for my submission site, which is used to generate the OG image you see in the site embed above! &lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/hiveWI11jms"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  My Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/multipletwigs" rel="noopener noreferrer"&gt;
        multipletwigs
      &lt;/a&gt; / &lt;a href="https://github.com/multipletwigs/pinata-og" rel="noopener noreferrer"&gt;
        pinata-og
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Pinata DEV Hackathon Submission | Pinata OG&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://private-user-images.githubusercontent.com/63769232/376111815-b6777c32-e11e-4c24-af0b-8bc5206fcc35.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjkwNDAxNjcsIm5iZiI6MTcyOTAzOTg2NywicGF0aCI6Ii82Mzc2OTIzMi8zNzYxMTE4MTUtYjY3NzdjMzItZTExZS00YzI0LWFmMGItOGJjNTIwNmZjYzM1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEwMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMDE2VDAwNTEwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI2ZmJkMGQzNTk5M2ZiMmI0NTdmZWMzNDcyYTExZGE3MzAxOTJlNDhmOTIyZmIyMzM4ZTlhNTRjN2Q2NGE2ZTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.knnI9BvHX4GbaBGhDmnUC3f3KZpYh3ldq9wqFc9s0dQ"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fprivate-user-images.githubusercontent.com%2F63769232%2F376111815-b6777c32-e11e-4c24-af0b-8bc5206fcc35.png%3Fjwt%3DeyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjkwNDAxNjcsIm5iZiI6MTcyOTAzOTg2NywicGF0aCI6Ii82Mzc2OTIzMi8zNzYxMTE4MTUtYjY3NzdjMzItZTExZS00YzI0LWFmMGItOGJjNTIwNmZjYzM1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEwMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMDE2VDAwNTEwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI2ZmJkMGQzNTk5M2ZiMmI0NTdmZWMzNDcyYTExZGE3MzAxOTJlNDhmOTIyZmIyMzM4ZTlhNTRjN2Q2NGE2ZTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.knnI9BvHX4GbaBGhDmnUC3f3KZpYh3ldq9wqFc9s0dQ" alt="site_ss"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Tired of your links being wallflowers at the social media party? Fear not! I've built a platform that would let you generate gorgeous OpenGraph Images With just a few clicks, and you'll be pumping out drop-dead gorgeous OpenGraph Images for your sites in seconds!&lt;/p&gt;
&lt;p&gt;Here's the deal: edit some fields, sprinkle your magic on it, and voilà! Your OG Image is ready to rock. But wait, there's more! We'll even generate those pesky metadata tags for you. Just copy, paste them into your &lt;code&gt;&amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;/code&gt; component, and you're good to go! It's so simple even your grandmother could do it!&lt;/p&gt;
&lt;p&gt;So, ready to give your links a glow-up and watch those click rates soar? Let's make your content pop!&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/multipletwigs/pinata-og" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;Built with...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pinata File API&lt;/li&gt;
&lt;li&gt;Supabase&lt;/li&gt;
&lt;li&gt;Shadcn/ui&lt;/li&gt;
&lt;li&gt;NextJS&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  More Details
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb545sq4x8m718ane776d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb545sq4x8m718ane776d.png" alt="Architecture Diagram of Pinata OG!" width="800" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's a rough sketch of Pinata OG! works...&lt;br&gt;
Journey of generating the needed metatags&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;OG Image is client-side generated with &lt;code&gt;html2canvas&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Along with all the metadata that the user input, this metadata is then submitted with the image in multiform &lt;code&gt;POST&lt;/code&gt; request. &lt;/li&gt;
&lt;li&gt;In a NextJS api route handler, we upload the image to Pinata and obtain a unique CID. &lt;/li&gt;
&lt;li&gt;This CID is then generated to the user and populated in the metatags. &lt;/li&gt;
&lt;li&gt;The og:url will be &lt;code&gt;/api/get-og?cid=[cid]&lt;/code&gt; which is another route handler used to actually serve the og images. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Journey of getting the og image when someone pastes a link&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;GET&lt;/code&gt; request from og:url to &lt;code&gt;/api/get-og?cid=[cid]&lt;/code&gt;, route handler requests from Pinata Gateway API.&lt;/li&gt;
&lt;li&gt;Pinata Gateway API does image optimizations to serve og:images faster!&lt;/li&gt;
&lt;li&gt;Because each image is unique, requesting for the correct image becomes very simple without the need to think of how to organize everyone's images. &lt;/li&gt;
&lt;li&gt;Just like that, &lt;code&gt;pinata.nightly.ink&lt;/code&gt; is now an og:image provider thanks to Pinata! &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Submission by: &lt;a class="mentioned-user" href="https://dev.to/nightlyinks"&gt;@nightlyinks&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Thank you for reading!
&lt;/h2&gt;

&lt;p&gt;I had a lot of fun building this, even if this doesn't win anything, I will still continue working on it because i believe in it! &lt;/p&gt;

&lt;p&gt;Ps.. this submission was made in two days because I couldn't decide what to build...&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>pinatachallenge</category>
      <category>webdev</category>
      <category>api</category>
    </item>
  </channel>
</rss>
