├── magpie
├── AUTHORS
├── scripts
│ ├── smarty_plugin
│ │ └── modifier.rss_date_parse.php
│ ├── magpie_simple.php
│ ├── templates
│ │ └── simple.smarty
│ ├── README
│ ├── magpie_slashbox.php
│ ├── simple_smarty.php
│ └── magpie_debug.php
├── CHANGES
├── README
├── NEWS
├── rss_utils.inc
├── cookbook
├── INSTALL
├── TROUBLESHOOTING
├── rss_cache.inc
├── htdocs
│ ├── cookbook.html
│ └── index.html
├── ChangeLog
├── rss_fetch.inc
├── rss_parse.inc
└── extlib
│ └── Snoopy.class.inc
├── rss_db
├── config.conf
├── logs
└── test
├── help.php
├── classReloader.php
├── userFunctions.php
├── botLogger.php
├── handle_functions.php
├── config.php
├── modules.php
├── db_users.php
├── db_rssFeeds.php
├── DBFunctions.php
├── RSSFunctions.php
└── bot.php
/magpie/AUTHORS:
--------------------------------------------------------------------------------
1 | kellan
2 |
--------------------------------------------------------------------------------
/rss_db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/torne/CrappyRSSBot/master/rss_db
--------------------------------------------------------------------------------
/config.conf:
--------------------------------------------------------------------------------
1 | #comment
2 | [connection]
3 | nick=crappyBot
4 | server=irc.netgamers.org
5 | port=6667
6 | user=crappy rss irc bot
7 | realname=crappy
8 | [channels]
9 | chan1=#wearelegion
10 | [database]
11 | dbname
12 | dbuser
13 | dbpass
--------------------------------------------------------------------------------
/logs/test:
--------------------------------------------------------------------------------
1 | some text
2 | some text
3 | some text
4 | some text
5 | some text
6 | 18/10/2009-21:58 - some text
7 | 20/10/2009-20:16 - some text
8 | 20/10/2009-20:16 - some text
9 | 20/10/2009-20:52 - some text
10 | 23/10/2009-22:08 - some text
11 | 23/10/2009-22:11 - some text
12 | 23/10/2009-22:14 - some text
13 | 23/10/2009-22:18 - some text
14 |
--------------------------------------------------------------------------------
/help.php:
--------------------------------------------------------------------------------
1 | _findClassByMethod( $bot, "_help_".$method );
20 | if ( !$objectname )
21 | return "No help for command $method.";
22 |
23 |
24 | //find the class that matches the method
25 | $object = new $objectname();
26 | return call_user_func( array($object, "_help_".$method) );
27 | }
28 |
29 | }
30 |
31 | ?>
--------------------------------------------------------------------------------
/classReloader.php:
--------------------------------------------------------------------------------
1 | _loadMethodMap($bot);
38 | return "$filename reloaded.";
39 | }
40 | else
41 | {
42 | return "$filename failed to reload.";
43 | }
44 | }
45 |
46 | }
47 |
48 | ?>
--------------------------------------------------------------------------------
/magpie/scripts/smarty_plugin/modifier.rss_date_parse.php:
--------------------------------------------------------------------------------
1 |
32 |
--------------------------------------------------------------------------------
/magpie/scripts/magpie_simple.php:
--------------------------------------------------------------------------------
1 | channel['title'] . "";
11 | echo "
";
12 | foreach ($rss->items as $item) {
13 | $href = $item['link'];
14 | $title = $item['title'];
15 | echo "- $title
";
16 | }
17 | echo "
";
18 | }
19 | ?>
20 |
21 |
25 |
26 |
27 |
Security Note:
28 | This is a simple example script. If this was a real script we probably wouldn't allow strangers to submit random URLs, and we certainly wouldn't simply echo anything passed in the URL. Additionally its a bad idea to leave this example script lying around.
29 |
--------------------------------------------------------------------------------
/userFunctions.php:
--------------------------------------------------------------------------------
1 | db = new db_users();
13 | $this->db->_connectUsers();
14 | }
15 |
16 | /**
17 | *
18 | * @param unknown_type $nick
19 | * @param unknown_type $password
20 | * @param unknown_type $email
21 | *
22 | */
23 | public function register( $bot, $password, $email )
24 | {
25 |
26 | if ( $this->db->_checkNickExists( $bot->_getNick() ) )
27 | {
28 | echo $this->db->_getUserMessage();
29 | }
30 | if ( $this->db->_checkEmailExists( $email ) )
31 | {
32 | echo $this->db->_getUserMessage();
33 | }
34 | }
35 |
36 | /**
37 | *
38 | * @param unknown_type $nick
39 | * @param unknown_type $password
40 | *
41 | */
42 | public function login( $nick, $password )
43 | {
44 | if ( !$this->db->_checkNickPassword( $nick, $password) )
45 | {
46 | echo $this->db->_getUserMessage();
47 | }
48 | }
49 |
50 | }
51 |
52 | ?>
--------------------------------------------------------------------------------
/magpie/scripts/templates/simple.smarty:
--------------------------------------------------------------------------------
1 |
2 |
3 | A Simple RSS Box: I'm not a designer
4 |
5 |
6 |
7 |
12 |
13 | Displaying: {$rss_url}
14 |
15 |
16 | {* if $error display the error
17 | elseif parsed RSS object display the RSS
18 | else solicit user for a URL
19 | *}
20 |
21 | {if $error }
22 | Error: {$error}
23 | {elseif $rss}
24 |
25 |
26 | |
27 | {$rss->channel.title}
28 | |
29 |
30 | {foreach from=$rss->items item=item}
31 |
32 | |
33 | {$item.title}
34 | |
35 |
36 | {$item.dc.date|rss_date_parse|date_format:"%A, %B %e, %Y"}
37 | |
38 |
39 | {/foreach}
40 |
41 | {else}
42 | Enter the URL of an RSS file to display.
43 | {/if}
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/magpie/scripts/README:
--------------------------------------------------------------------------------
1 | Some example on how to use Magpie:
2 |
3 | * magpie_simple.php *
4 | Simple example of fetching and parsing an RSS file. Expects to be
5 | called with a query param 'rss_url=http://'
6 |
7 | * simple_smarty.php *
8 | Similiar to magpie_simple, but using the Smarty template engine to do
9 | display. Also demostrates using rss_utils.inc and a smarty plugin to
10 | parse and display when each RSS item was published.
11 |
12 | * magpie_debug.php *
13 | Displays all the information available from a parsed feed.
14 |
15 | * smarty_plugin/modifier.rss_date_parse.php *
16 |
17 | A Smarty plugin for parsing RSS style dates. You must include rss_utils.inc
18 | for this plugin to work. It also must be installed in the Smarty plugin
19 | directory, see the Smarty docs for details.
20 |
21 | * templates/simple.smarty
22 | A Smarty template used by simple_smarty.php which demostrates
23 | displaying an RSS feed and using the date parse plugin.
24 |
25 |
26 | The Smarty template engine and documentation on how to use it are available from
27 | http://smarty.php.net
28 |
--------------------------------------------------------------------------------
/magpie/CHANGES:
--------------------------------------------------------------------------------
1 | Version 0.72
2 | -----------
3 | - fix security exploit: http://www.sec-consult.com/216.html
4 |
5 | Version 0.7
6 | -----------
7 | - support for input and output charset encoding
8 | based on the work in FoF, uses iconv or mbstring if available
9 | -
10 |
11 | Version 0.6
12 | -----------
13 | - basic support for Atom syndication format
14 | including support for Atom content constructs
15 | - fixed support for private feeds (HTTP Auth and SSL)
16 | (thanks to silverorange.com for providing test feeds)
17 | - support for some broken webservers
18 |
19 | Version 0.52
20 | -----------
21 | - support GZIP content negoiation
22 | - PHP 4.3.2 support
23 |
24 | Version 0.4
25 | -----------
26 | - improved error handling, better access for script authors
27 | - included example scripts of working with MagpieRSS
28 | - new Smarty plugin for RSS date parsing
29 |
30 | Version 0.3
31 | -----------
32 | - added support for conditional gets (Last-Modified, ETag)
33 | - now use Snoopy to handle fetching RSS files
34 |
35 | Version 0.2
36 | -----------
37 | - MAJOR CLEAN UP
38 | - removed kludgy $options array in favour of constants
39 | - phased out returning arrays
40 | - added better error handling
41 | - re-worked comments
42 |
--------------------------------------------------------------------------------
/botLogger.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/magpie/README:
--------------------------------------------------------------------------------
1 | NAME
2 |
3 | MagpieRSS - a simple RSS integration tool
4 |
5 | SYNOPSIS
6 |
7 | require_once(rss_fetch.inc);
8 | $url = $_GET['url'];
9 | $rss = fetch_rss( $url );
10 |
11 | echo "Channel Title: " . $rss->channel['title'] . "";
12 | echo "
";
13 | foreach ($rss->items as $item) {
14 | $href = $item['link'];
15 | $title = $item['title'];
16 | echo "- $title
";
17 | }
18 | echo "
";
19 |
20 | DESCRIPTION
21 |
22 | MapieRSS is an XML-based RSS parser in PHP. It attempts to be "PHP-like",
23 | and simple to use.
24 |
25 | Some features include:
26 |
27 | * supports RSS 0.9 - 1.0, with limited RSS 2.0 support
28 | * supports namespaces, and modules, including mod_content and mod_event
29 | * open minded [1]
30 | * simple, functional interface, to object oriented backend parser
31 | * automatic caching of parsed RSS objects makes its easy to integrate
32 | * supports conditional GET with Last-Modified, and ETag
33 | * uses constants for easy override of default behaviour
34 | * heavily commented
35 |
36 |
37 | 1. By open minded I mean Magpie will accept any tag it finds in good faith that
38 | it was supposed to be here. For strict validation, look elsewhere.
39 |
40 |
41 | GETTING STARTED
42 |
43 |
44 |
45 | COPYRIGHT:
46 | Copyright(c) 2002 kellan@protest.net. All rights reserved.
47 | This software is released under the GNU General Public License.
48 | Please read the disclaimer at the top of the Snoopy.class.inc file.
49 |
--------------------------------------------------------------------------------
/magpie/scripts/magpie_slashbox.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
12 |
13 |
16 |
17 | ";
21 | $rss = fetch_rss( $url );
22 | echo slashbox ($rss);
23 | }
24 |
25 | echo "";
26 | print_r($rss);
27 | echo "
";
28 | ?>
29 |
30 |
31 |