This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class pubsubhubbub{ | |
var $callback_url; //the url we need to post the updates to | |
var $title; //the title of the url | |
var $created_time; //time is was created | |
var $subscription_state;//the state of the subscription (pending for confirmation/ verified) | |
function __construct() //we accept the above parameters and save it in the db. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//resides in the webapp folder. | |
require_once ('config.webapp.inc.php'); | |
ini_set("include_path", ini_get("include_path").PATH_SEPARATOR.$INCLUDE_PATH); | |
require_once ("init.php"); | |
$THINKTANK_CFG['site_url'] = 'http://localhost'; //this will go in config.inc.php | |
$db = new Database($THINKTANK_CFG); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//initialized in config.inc.php | |
$THINKTANK_CFG['site_url'] = ""; | |
require_once ("common/init.php"); | |
$db = new Database($THINKTANK_CFG); | |
$conn = $db->getConnection(); | |
$cfg = new Config(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:georss="http://www.georss.org/georss"> | |
<channel> | |
<title>Public Timeline</title> | |
<link>{$cfg->site_url}{$cfg->site_root_path}public.php?v={$option}</link> | |
<atom:link type="application/rss+xml" href="{$cfg->site_url}{$cfg->site_root_path}rss.php?v={$option}" rel="self"/> | |
<description>The latest from ThinkTank</description> | |
<language>en</language> | |
{foreach item=post from=$posts} | |
<item> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local st = require "util.stanza"; | |
local reply = st.stanza("message"); | |
reply:tag("body"):text("Enter the valid keys"):up() | |
:tag("x", {xmlns="jabber:x:oob"}):tag("url"):text("some_url"):up():up() | |
:tag("captcha", {xmlns="urn:xmpp:captcha"}):up(); | |
print (reply); | |
-- <message><body>Enter the valid keys</body><x xmlns='jabber:x:oob'> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local st = require "util.stanza"; | |
local host = module:get_host(); | |
local stun_ip = module:get_option('stun_ip'); | |
local stun_port = module:get_option_number('stun_port'); | |
local uuid = require "util.uuid"; | |
module:add_feature('http://jabber.org/protocol/jinglenodes'); | |
module:hook('iq-get/host/http://jabber.org/protocol/jinglenodes', function(event) | |
local session, stanza = event.origin, event.stanza; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Jingle Channel Implementation | |
local _G = _G; | |
local prosody = _G.prosody; | |
local hosts = prosody.hosts; | |
local connlistener_register = require "net.connlisteners".register; | |
local localport = module:get_option_number("jingle_channel_read_port") or 35800; | |
local remoteport = module:get_option_number("jingle_channel_write_port") or 35802; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- STUN server | |
local _G = _G; | |
local prosody = _G.prosody; | |
local hosts = prosody.hosts; | |
local connlisteners_register = require "net.connlisteners".register; | |
local stun_listener = { default_port = 3478; default_mode = "*a"; default_interface = "*" }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def load(self): | |
self.plugins = ['monit', 'opensips', 'sshd'] | |
self.fetch_config() | |
plugins = {} | |
for plugin in self.plugins: | |
# get_class_name returns the class nume for that plugin, | |
# for a new plugin we need to have a standard class name | |
# for example the module name capitalized with the first word | |
plugins[plugin] = getattr(__import__(plugin), get_class_name(plugin)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once "plivo.php"; | |
$r = new Response(); | |
$speak_body = "Please leave a message after the beep. Press the star key when done."; | |
$r->addSpeak($speak_body); |
OlderNewer