Skip to content

Commit

Permalink
✨ add command to convert twitter link to nitter (#863)
Browse files Browse the repository at this point in the history
* ✨ add command to convert twitter link to nitter

* 💡 update dependencies

Co-authored-by: Thiago Holanda <[email protected]>

* 💡 update author url to github

Co-authored-by: Thiago Holanda <[email protected]>

* ✨ remove the need for manual pasting

Co-authored-by: Thiago Holanda <[email protected]>

---------

Co-authored-by: Thiago Holanda <[email protected]>
  • Loading branch information
noidwasavailable and unnamedd committed Aug 10, 2023
1 parent cfda5e9 commit 863e081
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions commands/browsing/convert-twitter-to-nitter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env node
// Dependency: This script requires Nodejs.
// Install Node: https://nodejs.org/en/download/

// Required parameters:
// @raycast.schemaVersion 1
// @raycast.title Convert Twitter to Nitter
// @raycast.mode silent

// Optional parameters:
// @raycast.icon 🐔

// Documentation:
// @raycast.description Convert Twitter link to Nitter
// @raycast.author cSharp
// @raycast.authorURL https://github.com/noidwasavailable

// Example Twitter link: https://twitter.com/Cron/status/1644010827647975425
const child_process = require('child_process');
let link = child_process.execSync("pbpaste").toString();

if (!link) {
console.error('No link provided');
return;
}

try {
link = link.replace('twitter.com', 'nitter.net');
console.log(`Opening ${link}`);
child_process.execSync(`open "${link}"`);
return;
} catch (error) {
console.error('Invalid link provided');
return;
}

0 comments on commit 863e081

Please sign in to comment.