Results 1 to 5 of 5
-
31st Oct 2009, 06:42 AM #1OPRespected DeveloperWebsite's:
X4B.orgAnother one of my infamous code snippets
Ok, I wont post the full snippet because not many people need to extract group name and release type and the code isnt that great for that part.
Class: SceneName
Description: Parses the scene format for TV Shows. Persumes that the source follows the correct nameing structure.
PHP Code:<?
/*
Class: SceneName
Description: Parses the scene format for TV Shows. Persumes that the source follows the correct nameing structure.
written by splitice (thewarezscene.org)
*/
class SceneName {
private $text = '';
private $parsed = array();
private function _parse(){
$p = explode('.',$this->text);
$season = array();
$name = '';
foreach($p as $v){
if($v{0}=='S'&&$v{3}=='E'){//Season Number Episode Number
$season['season'] = (int)($v{1}.$v{2});
$season['episode'] = (int)($v{4}.$v{5});
}else if($v{0}=='S'){ //Just season
$season['season'] = (int)($v{1}.$v{2});
}else{
if($season){
}else{
if($name) $name.= ' ';
$name.=$v;
}
}
}
if(!$season){
trigger_error('SceneName: cant recognise season');
return false;
}
if(!$name){
trigger_error('SceneName: cant recognise show name');
return false;
}
$this->parsed = array('name'=>$name,'show'=>$season);
}
function name(){
if(!$this->parsed) $this->_parse();
return $this->parsed['name'];
}
function show(){
if(!$this->parsed) $this->_parse();
return $this->parsed['show'];
}
function SceneName($text){
$this->text = $text;
}
function __toString(){
return $this->text;
}
}
?>SplitIce Reviewed by SplitIce on . Another one of my infamous code snippets Ok, I wont post the full snippet because not many people need to extract group name and release type and the code isnt that great for that part. Class: SceneName Description: Parses the scene format for TV Shows. Persumes that the source follows the correct nameing structure. <? /* Class: SceneName Description: Parses the scene format for TV Shows. Persumes that the source follows the correct nameing structure. Rating: 5
-
1st Nov 2009, 01:55 PM #2
-
1st Nov 2009, 02:59 PM #3Member
good share
Please follow signature rules
-
1st Nov 2009, 04:05 PM #4(╯?□?)╯︵ ┻━┻Website's:
Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.cominfamous implies that it is famous for being bad.
but its not famous either, maybe "useful" would be a better word lol.
Anyway good snippet, just fooling around.Projects:
WCDDL - The Professional DDL Script
Top Secret Project: In Development - ZOMG
ImgTrack - Never Have Dead Images Again!
-
1st Nov 2009, 10:24 PM #5OPRespected DeveloperWebsite's:
X4B.org
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Wikipedia plugin - extract info from wikipedia using snippets??
By Darlos in forum WordpressReplies: 3Last Post: 3rd Jan 2012, 02:55 PM -
Need a good coder to code a skin, I will show you what I need, you just code it
By Nickk96 in forum Web Development AreaReplies: 1Last Post: 27th Aug 2011, 01:45 PM -
Infographic: 25 Infamous Computer Viruses In 25 Years
By b1u3eyes in forum General DiscussionReplies: 9Last Post: 17th May 2011, 06:19 PM -
Snippets & Random Crap (Linkify text links included)
By JmZ in forum Web Development AreaReplies: 0Last Post: 9th Apr 2011, 05:34 AM -
Infamous Chinese pirates launch Ubuntu that looks just like Windows XP
By EvilGenius in forum General DiscussionReplies: 0Last Post: 28th Dec 2009, 10:06 AM
themaLeecher - leech and manage...
Version 5.03 released. Open older version (or...