Example #1
0
/**
 * Add the link to the item actions
 *
 * @param array $actions Previous actions
 * @return array Array with Tweet It added.
 */
function instapaper_button($actions)
{
    require_once LILINA_PATH . '/admin/includes/common.php';
    $tweet_url = sprintf(get_option('baseurl') . '?method=instapaper&id=%1$s&_nonce=%2$s', get_the_id(), generate_nonce());
    $actions[] = '<a href="' . $tweet_url . '" class="instapaper_button" title="' . _r('Save to Instapaper', 'instapaper') . '">' . _r('Read Later', 'instapaper') . '</a>';
    return $actions;
}
 public function __construct()
 {
     if (empty($this->name)) {
         $this->name = _r('Unnamed Service');
     }
     if (empty($this->description)) {
         $this->description = sprintf(_r('No description for %s'), $this->name);
     }
     if (empty($this->label)) {
         $this->label = sprintf(_r('Send to %s'), $this->name);
     }
     if (empty($this->nonce)) {
         $this->nonce = $this->name;
     }
     $nonce = generate_nonce($this->nonce);
     $this->action = get_option('baseurl') . '?method=' . $this->method . '&item={hash}&_nonce=' . $nonce;
 }
Example #3
0
			<select id="timezone" name="timezone">
				<?php 
foreach (timezone_identifiers_list() as $tz) {
    echo '<option';
    if ($tz === get_option('timezone')) {
        echo ' selected="selected"';
    }
    echo '>', $tz, '</option>';
}
?>
			</select>
		</div>
	</fieldset>
	<input type="hidden" name="action" value="settings" />
	<input type="hidden" name="_nonce" value="<?php 
echo generate_nonce();
?>
" />
	<input type="submit" value="<?php 
_e('Save');
?>
" class="submit" />
</form>
<form action="settings.php" method="post">
	<fieldset id="plugins">
		<legend><?php 
_e('Plugin Management');
?>
</legend>
		<table class="item-table">
			<thead>
Example #4
0
    public static function from_consumer_and_token(
	$consumer, $token=null, $http_method="POST", $http_url=null,
	$parameters=null, $body='', $is_form_encoded=False) {
	if (!isset($parameters))
	    $parameters = array();

	$defaults = array (
	    'oauth_consumer_key' => $consumer->key,
	    'oauth_timestamp' => make_timestamp(),
	    'oauth_nonce' => generate_nonce(),
	    'oauth_version' => Request::$version,
	);
	$parameters = array_merge($defaults, $parameters);

	if (isset($token)) {
	    $parameters['oauth_token'] = $token->key;
	    if (isset($token->verifier))
		$parameters['oauth_verifier'] = $token->verifier;
	}
	return new Request($http_method, $http_url, $parameters,
	    $body, $is_form_encoded);
    }
Example #5
0
        the_content();
        ?>
 
                
			<!-- <section class="sns">
				<p class="txt_timeline"><img src="/blog/wp-content/themes/somsommi/images/twitter-bird-light-bgs1.png" alt="Som's twitter"> SOM Timeline</p>
			<?php 
        define('SCREEN_NAME', 'baninana');
        define('COUNT', '5');
        // define('ENDPOINT_URL', 'https://api.twitter.com/1.1/statuses/home_timeline.json');
        define('ENDPOINT_URL', 'https://api.twitter.com/1.1/statuses/user_timeline.json');
        define('CONSUMER_KEY', 'kN2f96aNT48sdHrhJPUPg');
        define('CONSUMER_SECRET', '7yUer6SCEt5q5cKmNmkeprqFYHRrPDwhi5sbQb2QI');
        define('ACCESS_TOKEN', '124910554-fPpWVgiXmQ4E9AkRioG2AJnRCMOUlPgwmg2J2hD0');
        define('ACCESS_TOKEN_SECRET', '9mlt5vJs0vqzsKRZuHGuMQmB93yi4tL0nC5rLHOOnW8');
        $nonce = generate_nonce();
        $timestamp = generate_timestamp();
        $text1 = "GET&" . urlencode(ENDPOINT_URL) . "&";
        $text2 = "count=" . COUNT . "&" . "oauth_consumer_key=" . CONSUMER_KEY . "&" . "oauth_nonce=" . $nonce . "&" . "oauth_signature_method=HMAC-SHA1" . "&" . "oauth_timestamp=" . $timestamp . "&" . "oauth_token=" . ACCESS_TOKEN . "&" . "screen_name=" . SCREEN_NAME;
        $text3 = urlencode(CONSUMER_SECRET) . "&" . urlencode(ACCESS_TOKEN_SECRET);
        $oauth_signature = base64_encode(hash_hmac('sha1', $text1 . urlencode($text2), $text3, true));
        $url = ENDPOINT_URL . "?" . $text2 . "&oauth_signature=" . urlencode($oauth_signature);
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $output = curl_exec($ch);
        curl_close($ch);
        if ($output) {
            $tweets = json_decode($output, true);
            print_r("<ol class=\"twitter\">");
            foreach ($tweets as $tweet) {
Example #6
0
			<label for="timezone"><?php _e('Timezone'); ?>:</label>
			<select id="timezone" name="timezone">
				<?php
				foreach(timezone_identifiers_list() as $tz) {
					echo '<option';
					if($tz === get_option('timezone')) {
						echo ' selected="selected"';
					}
					echo '>', $tz, '</option>';
				}
				?>
			</select>
		</div>
	</fieldset>
	<input type="hidden" name="action" value="settings" />
	<input type="hidden" name="_nonce" value="<?php echo generate_nonce() ?>" />
	<p class="buttons"><button type="submit" class="positive"><?php _e('Save') ?></button></p>
</form>
<form action="settings.php" method="post">
	<fieldset id="plugins">
		<legend><?php _e('Plugin Management'); ?></legend>
		<table class="item-table">
			<thead>
				<tr>
					<th scope="col"><?php _e('Plugin') ?></th>
					<th scope="col"><?php _e('Version') ?></th>
					<th scope="col"><?php _e('Description') ?></th>
					<th scope="col"><?php _e('Status') ?></th>
					<th scope="col"><?php _e('Action') ?></th>
				</tr>
			</thead>
Example #7
0
?>
</p>
		<p><?php 
printf(_r('For information on using cron with this URL, see the <a href="%s">documentation</a>.'), 'http://codex.getlilina.org/wiki/Updating_Feeds');
?>
</p>
	</fieldset>
	<?php 
do_action('options-form');
?>
	<?php 
AdminOptions::instance()->do_sections();
?>
	<input type="hidden" name="action" value="settings" />
	<input type="hidden" name="_nonce" value="<?php 
echo generate_nonce('settings');
?>
" />
	<p class="buttons"><button type="submit" class="positive"><?php 
_e('Save');
?>
</button></p>
</form>
<form action="settings.php" method="post">
	<fieldset id="plugins">
		<legend><?php 
_e('Plugin Management');
?>
</legend>
		<table class="item-table">
			<thead>