Last active
January 11, 2017 16:22
-
-
Save scottcowan/b3a54009ebc812d73e63a82cb1741320 to your computer and use it in GitHub Desktop.
Add a torrent link to an rss feed file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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\"" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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