OPiQuotations  v.03.00.00 — April 5, 2019
Namespaces | Variables
une-OPiCitation-pour-Twitter.php File Reference

Little PHP application to send one quotation (from OPiCitations) to Twitter account https://twitter.com/OPiCitationJour. More...

Go to the source code of this file.

Namespaces

 OPiCitations
 

Variables

if(true) else
 
 $LABEL = 'Twitter - OPiCitationJour'
 
 $opiquotations = new OPiQuotations\OPiQuotations()
 
 $quot = $opiquotations->quotation_by_random($LABEL)
 
 if ( $quot===null)
 
 $connection = new TwitterOAuth($consumer_key, $consumer_secret, $access_token, $access_token_secret)
 
 $result = $connection->get('help/configuration')
 
 $short_url_length
 
if(true) $max_length = 280
 
if(true) $selection = new OPiQuotations\Selection($LABEL, NULL, $url)
 
 $ok = $opiquotations->quotation_add_selection($quot, $selection)
 

Detailed Description

Little PHP application to send one quotation (from OPiCitations) to Twitter account https://twitter.com/OPiCitationJour.

(June 28, 2018)

Use the https://github.com/abraham/twitteroauth library.

Piece of OPiQuotations. https://bitbucket.org/OPiMedia/opiquotations

GPLv3 — Copyright (C) 2014, 2016, 2017, 2018 Olivier Pirson http://www.opimedia.be/

Definition in file une-OPiCitation-pour-Twitter.php.

Variable Documentation

◆ $connection

$connection = new TwitterOAuth($consumer_key, $consumer_secret, $access_token, $access_token_secret)

Definition at line 90 of file une-OPiCitation-pour-Twitter.php.

◆ $LABEL

$LABEL = 'Twitter - OPiCitationJour'

Definition at line 63 of file une-OPiCitation-pour-Twitter.php.

◆ $max_length

if (true) $max_length = 280

Definition at line 105 of file une-OPiCitation-pour-Twitter.php.

◆ $ok

$ok = $opiquotations->quotation_add_selection($quot, $selection)

Definition at line 171 of file une-OPiCitation-pour-Twitter.php.

◆ $opiquotations

$opiquotations = new OPiQuotations\OPiQuotations()

Definition at line 66 of file une-OPiCitation-pour-Twitter.php.

◆ $quot

$quot = $opiquotations->quotation_by_random($LABEL)

Definition at line 68 of file une-OPiCitation-pour-Twitter.php.

◆ $result

$result = $connection->get('help/configuration')

Definition at line 92 of file une-OPiCitation-pour-Twitter.php.

◆ $selection

if (true) $selection = new OPiQuotations\Selection($LABEL, NULL, $url)

Definition at line 169 of file une-OPiCitation-pour-Twitter.php.

◆ $short_url_length

$short_url_length
Initial value:
= (empty($result->errors)
? $result->short_url_length
: 23)

Definition at line 93 of file une-OPiCitation-pour-Twitter.php.

Referenced by OPiQuotations\OPiQuotation\to_text_twitter().

◆ else

for ( $try=0;$try< 5;++ $try, -- $max_length) if (!empty( $result->errors)) if (empty( $result->id)) else
Initial value:
{
#DEBUG_END
ini_set('display_errors', 'stderr')

Definition at line 37 of file une-OPiCitation-pour-Twitter.php.

◆ if

if($quot===null)

Definition at line 77 of file une-OPiCitation-pour-Twitter.php.