<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>ClipboardFusion RSS: Macro: Shorten YouTube video link</title>
<atom:link href="https://www.clipboardfusion.com/Discussions/RSS/?TopicID=d177dc8e-7e80-4d38-8c5d-f18a69b0ae08" rel="self" type="application/rss+xml" />
<link>https://www.clipboardfusion.com/Discussions/RSS/?TopicID=d177dc8e-7e80-4d38-8c5d-f18a69b0ae08</link>
<description>ClipboardFusion RSS: Macro: Shorten YouTube video link</description>
<lastBuildDate>Wed, 13 May 2026 02:14:25 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.clipboardfusion.com/Discussions/RSS/?TopicID=d177dc8e-7e80-4d38-8c5d-f18a69b0ae08</generator>
<item>
<title>RE: Macro: Shorten YouTube video link</title>
<link>https://www.clipboardfusion.com/Discussions/View/macro-shorten-youtube-video-link/?ID=d177dc8e-7e80-4d38-8c5d-f18a69b0ae08#2</link>
<pubDate>Wed, 04 Jan 2017 14:07:17 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/macro-shorten-youtube-video-link/?ID=d177dc8e-7e80-4d38-8c5d-f18a69b0ae08#2</guid>
<category>ClipboardFusion</category>
<description><![CDATA[Thanks for sharing that! I've posted it to the online repository as well, which is accessible via the "Download Pre-Made Macros" button in the ClipboardFusion settings]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Thanks for sharing that! I've posted it to the online repository as well, which is accessible via the "Download Pre-Made Macros" button in the ClipboardFusion settings <img src="https://www.clipboardfusion.com/MediaCommon/SVGs/FontAwesome/face-smile.light.svg" alt=":)" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:16px;height:16px;" HelpButtonData=":)" HelpButtonDataAlign="BelowMiddle" />
</div>
]]></content:encoded>
</item>
<item>
<title>Macro: Shorten YouTube video link</title>
<link>https://www.clipboardfusion.com/Discussions/View/macro-shorten-youtube-video-link/?ID=d177dc8e-7e80-4d38-8c5d-f18a69b0ae08</link>
<pubDate>Fri, 30 Dec 2016 16:57:44 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/macro-shorten-youtube-video-link/?ID=d177dc8e-7e80-4d38-8c5d-f18a69b0ae08</guid>
<category>ClipboardFusion</category>
<description><![CDATA[Here's a quick macro to shorten a YouTube video from the full https://www.youtube.com/watch?v=&lt;id&gt; to the shortened youtu.be version.
I've attached the .cfmacro file below for easy importing into ClipboardFusion, or here's the source.
Code
Copy
Select All
using System;
using System.Te...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Here's a quick macro to shorten a YouTube video from the full https://www.youtube.com/watch?v=&lt;id&gt; to the shortened youtu.be version.<br/>
<br/>
I've attached the .cfmacro file below for easy importing into ClipboardFusion, or here's the source.<br/>
<br/>
<div class="col-md-12 BoxWrap"><div class="Box table-responsive"><a name="code" style="width:0; height:0;"></a><h2 class="TableTitle" style="border:0"><div class="TableTitleText">Code</div><div class="TitleButtons"><div class="TableTitleButton"><a href="#" onclick="return false;" data-clipboard-target="#code019e1f1d28b57775a4543eebe644cc33" class="ClipboardCopyControl"><img src="https://www.clipboardfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019e1f1d28b57775a4543eebe644cc33Js'); return false;"><img src="https://www.clipboardfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Select All</span></a></div></div></h2><div class="TableTitleContent table-responsive"><div class="AceEditorWrapper" style="border-top:solid 1px var(--color-default-border);padding:0"><pre id="code019e1f1d28b57775a4543eebe644cc33Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Text.RegularExpressions;

public static class ClipboardFusionHelper
{
    public static string ProcessText(string text)
    {
        Regex youtubeRegex = new Regex(@"https://www\.youtube\.com\/watch\?v\=(?&lt;id&gt;[^\&]*)(?:\&.*)?");
        Match match = youtubeRegex.Match(text);

        if (!match.Success) {
            // If this isn't a YouTube video, don't do anything to it
            return text;
        }

        Group idGroup = match.Groups["id"];
        string idText = idGroup.Value;
        return "https://youtu.be/" + idText;
    }
}</pre><textarea id="code019e1f1d28b57775a4543eebe644cc33" name="code019e1f1d28b57775a4543eebe644cc33" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div><br/>
<br/>
If there's a better place to submit this, please let me know and I can re-submit. <img src="https://www.clipboardfusion.com/MediaCommon/SVGs/FontAwesome/face-smile.light.svg" alt=":)" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:16px;height:16px;" HelpButtonData=":)" HelpButtonDataAlign="BelowMiddle" /><br/>
<br/>
Hopefully someone can find this useful!
</div>
]]></content:encoded>
</item>
</channel>
</rss>