you're reading...
Source Code

How to Make a Bot : SHOUTcast Bot

How to make a bot to run SHOUTcast with a quick and simple bit of irc bot source code for relaying information from your SHOUTcast into IRC channels. This bot is setup to only relay the current song, however could be easily extended to do more.
rss reddit irc bot c# command line

It is achieved through the use of a standard irc engine that powers all my basic command oriented bots, this engine is not suitable for spam. Commands are then passed back to a command parser handler.

rss reddit irc bot c# command line

The basic SHOUTcast information page is then scraped for the necessary information and passed back to the channel. The current song was sufficient for my needs.

However you can definitely see where there is more information that users may want to see in channel, or even where you could trigger an event to only start spamming a channel once your active listeners dropped below a certain point.

rss reddit irc bot c# command line

Because the SHOUTcast page is not scraper friendly, we have to do a couple things to make sure we are able to parse the data. There are 2 main hangups.
1. The page detects your user agent and relays different data depending on the browser. To overcome this I am simulating an IE7 browser.

2. The headers returned are not safe for the .net framework and WILL cause a crash. With a WebApplication this is easily overcome with a simple edit to the web.config. However with a regular application it is a lil more tricky. Fortunately I found some code where another dev had gone back and reverse engineered the actions taken by the framework upon reading such an entry in a web.config file and replicated them for a regular application.

rss reddit irc bot c# command line

About Pythorian

Exploration and Production oriented security consultant for securing IT infrastructures relating to natural resources.


No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: