Usage - Atelier-Shiori/detectstream Wiki

Objective C

// Import Headers
#import <DetectStreamKit/DetectStreamKit.h>

// Create an instance of DetectStreamManager
DetectStreamManager *detectstreammgr = [DetectStreamManager new];

// Detect any streams
NSDictionary * d = [_detectstreammgr detectStream];

// Check if we are playing anything
if (d[@"result" == [NSNull null]) {
	// Nothing is playing
	NSLog(@"Nothing Playing!");
}
else {
	// Populate Data
	NSString * title = [d [email protected]"title"];
	NSNumber * episode = [d [email protected]"episode"];
	NSNumber * season = [d [email protected]"season"];
	NSString * site = [d [email protected]"site"];
	// Print the stream information
	NSLog(@"%@ - %d - %d - %@", title, [episode intValue], [season intValue], site);
}