Changeset 179
- Timestamp:
- 10/21/08 01:46:24 (3 months ago)
- Location:
- hellaworld/branches/autonzb
- Files:
-
- 7 added
- 7 modified
-
. (modified) (1 prop)
-
README-AUTONZB (added)
-
classes (modified) (1 prop)
-
classes/atom-feed.php (added)
-
classes/nzb-helper.php (added)
-
classes/xml-dataset.php (added)
-
cron.php (added)
-
feeds.xml (added)
-
index.php (modified) (2 diffs)
-
js (modified) (1 prop)
-
js/autonzb.js (added)
-
style (modified) (1 prop)
-
templates (modified) (1 prop)
-
templates/default.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hellaworld/branches/autonzb
- Property svn:ignore
-
old new 1 1 config.php 2 ._*
-
- Property svn:ignore
-
hellaworld/branches/autonzb/classes
-
Property
svn:ignore set
to
._*
-
Property
svn:ignore set
to
-
hellaworld/branches/autonzb/index.php
r172 r179 98 98 99 99 require_once 'classes/HellaController.php'; 100 101 require_once('classes/xml-dataset.php'); 102 require_once('classes/atom-feed.php'); 103 require_once('classes/nzb-helper.php'); 100 104 101 105 if ($auth == 'exclusive' && !ipInRange($iprange, $_SERVER['REMOTE_ADDR'])) { … … 354 358 } 355 359 } 360 361 // Auto-NZB 362 if (array_key_exists('addfeed', $_GET)) { 363 $dataset = new XML_Dataset('./feeds.xml'); 364 365 // Check we don't already have this feed... 366 foreach ($dataset->feed as $feed) 367 if ($feed->attributes()->url == $_GET['addfeed']) 368 throw new Exception('Feed already processed.'); 369 370 // Add the new feed! 371 $atom = new Atom_Feed($_GET['addfeed']); 372 $latest = reset($atom->entry); 373 $parsed = nzb::parse($latest); 374 375 $feed = $dataset->addNode('feed', array('url' => $_GET['addfeed'])); 376 $feed->addAttribute('name', $parsed->show); 377 $feed->addAttribute('latest_episode', $parsed->episode); 378 $dataset->save(); 379 } 356 380 357 381 } catch (Exception $e) { -
hellaworld/branches/autonzb/js
-
Property
svn:ignore set
to
._*
-
Property
svn:ignore set
to
-
hellaworld/branches/autonzb/style
-
Property
svn:ignore set
to
._*
-
Property
svn:ignore set
to
-
hellaworld/branches/autonzb/templates
-
Property
svn:ignore set
to
._*
-
Property
svn:ignore set
to
-
hellaworld/branches/autonzb/templates/default.php
r170 r179 158 158 <?php if (isset($config['showfinished']) && $config['showfinished']): ?><li><a accesskey="2" href="#fragment-2"><span><?php echo _('Finished Items'); ?></span></a></li><?php endif; ?> 159 159 <li><a accesskey="3" href="#fragment-3"><span><?php echo _('Bookmarklet'); ?></span></a></li> 160 <li><a accesskey="4" href="#fragment-4"><span><?php echo _('NZB Feeds'); ?></span></a></li> 160 161 </ul> 161 162 <div id="fragment-1"> … … 208 209 <p class="bkmark"><?php echo _("Right click on this link and bookmark it, or drag it to your bookmarks/favorites to create a Newzbin shortcut. Clicking on this shortcut when on a Newzbin article will add the NZB to HellaNZB's queue."); ?></p> 209 210 <p class="bkmark"><a href="javascript:c=location.href;if(c.match(/browse\/post\/\d+/)){location.href='<?php echo $protocol . '://' . htmlentities($_SERVER['HTTP_HOST']) . $self ?>?bookmarklet='+encodeURIComponent(c);}else{void(0);}"><?php echo _('Send to HellaWorld'); ?></a></p> 210 </div> 211 <p class="bkmark"><a href="javascript:<?php 212 $hw_url = $protocol.'://'.htmlentities($_SERVER['HTTP_HOST']).dirname($self); 213 echo "var hw_url = '".$hw_url."'; var scriptElem = document.createElement('script');scriptElem.type = 'text/javascript';scriptElem.src = '".$hw_url."/js/autonzb.js';document.body.appendChild(scriptElem);void(0);"; ?>">NZB RSS to HellaWorld</a></p> 214 </div> 215 216 <div id="fragment-4"> 217 <h2>NZB Feeds</h2> 218 <ul> 219 <?php 220 if (! isset($dataset)) 221 $dataset = new XML_Dataset('./feeds.xml'); 222 if (count($dataset->feed) == 0) 223 echo '<li>There are no feeds to display.</li>', "\n"; 224 else 225 foreach ($dataset->feed as $feed) { 226 $attrs = $feed->attributes(); 227 echo sprintf('<li>%s (%s)</li>', $attrs->name, $attrs->latest_episode), "\n"; 228 } 229 ?> 230 </ul> 231 </div> 211 232 </div> 212 233 </body>
