Skip to content

Instantly share code, notes, and snippets.

@scottcowan
Last active January 11, 2017 16:22
Show Gist options
  • Save scottcowan/b3a54009ebc812d73e63a82cb1741320 to your computer and use it in GitHub Desktop.
Save scottcowan/b3a54009ebc812d73e63a82cb1741320 to your computer and use it in GitHub Desktop.
Add a torrent link to an rss feed file
package main
import (
"fmt"
"os"
"strings"
)
func main() {
fmt.Println(os.Args[1])
link := strings.Replace(os.Args[1], "\"", "", -1)
filename := "C:\\Users\\scottcowan\\Dropbox\\Incoming\\TorrentFeed\\magnet_rss.xhtml"
f, err := os.OpenFile(filename, os.O_APPEND, 0666)
if err == nil {
f.WriteString("\n<item><title><![CDATA[magnet-$random]]></title><link>" + link + "</link></item>")
f.Close()
} else {
fmt.Println(err)
}
}
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Magnet]
@="Magnet URI"
"URL Protocol"=""
"Content Type"="application/x-magnet"
[HKEY_CLASSES_ROOT\Magnet\DefaultIcon]
@="C:\\Users\\scottcowan\\AppData\\Roaming\\uTorrent\\maindoc.ico"
[HKEY_CLASSES_ROOT\Magnet\shell]
@="open"
[HKEY_CLASSES_ROOT\Magnet\shell\open]
[HKEY_CLASSES_ROOT\Magnet\shell\open\command]
@="\"C:\\Users\\scottcowan\\Dropbox\\Incoming\\TorrentFeed\\magnet.exe\" \"%1\""
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE torrent PUBLIC "-//bitTorrent//DTD torrent 0.1//EN" "http://xmlns.ezrss.it/0.1/dtd/">
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>magnet_rss</title>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment