
Product
Socket Now Supports pylock.toml Files
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
github.com/konishchevdmitry/go-rss
Simple RSS parser and generator for Go
Usage example:
package main
import (
"fmt"
"github.com/KonishchevDmitry/go-rss"
)
var rssData = `
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>Feed title</title>
<link>http://example.com/</link>
<description>Feed description</description>
<item>
<title>Item 1</title>
<link>http://example.com/item1</link>
<description>Item 1 description</description>
</item>
</channel>
</rss>
`
func main() {
url := "http://example.com/feed.rss"
// Get an RSS feed from URL
feed, err := rss.Get(url)
if err != nil {
fmt.Printf("Failed to get %s: %s\n", url, err)
}
// Get an RSS feed from string
feed, err = rss.Parse([]byte(rssData))
if err != nil {
fmt.Println("Parsing error:", err)
return
}
// Change <generator> element value
feed.Generator = "go-rss"
// Generate the modified RSS feed
data, err := rss.Generate(feed)
if err != nil {
fmt.Println("RSS generation error:", err)
return
}
fmt.Printf("%s\n", data)
}
Output:
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>Feed title</title>
<link>http://example.com/</link>
<description>Feed description</description>
<generator>go-rss</generator>
<item>
<title>Item 1</title>
<link>http://example.com/item1</link>
<description>Item 1 description</description>
</item>
</channel>
</rss>
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnam’s Telegram ban.