tinycm rev 97

Add Twitter timeline support to community plugin
author Christophe Lincoln <pankso@slitaz.org>
date Sun Feb 19 23:46:04 2017 +0100 (2017-02-19)
parents 345ecf7eee37
children 538ed788329d
files plugins/community/community.cgi plugins/community/community.conf
line diff
     1.1 --- a/plugins/community/community.cgi	Fri Feb 17 13:56:41 2017 +0100
     1.2 +++ b/plugins/community/community.cgi	Sun Feb 19 23:46:04 2017 +0100
     1.3 @@ -43,7 +43,7 @@
     1.4  		if check_auth; then
     1.5  			cat << EOT
     1.6  
     1.7 -<form method="get" action="$script" id="wall-form" name ="wall" onsubmit="return checkWall();">
     1.8 +<form method="get" action="$script" id="wall-form" name="wall" onsubmit="return checkWall();">
     1.9  	<input type="hidden" name="wall" />
    1.10  	<textarea name="message" maxlength="${WALL_MESSAGES_LENGTH}"></textarea>
    1.11  	<div>
    1.12 @@ -87,6 +87,17 @@
    1.13  		fi
    1.14  		html_footer && exit 0 ;;
    1.15  	
    1.16 +	*\ twitter\ *)
    1.17 +		header
    1.18 +		html_header
    1.19 +		user_box
    1.20 +		cat << EOT
    1.21 +<a class="twitter-timeline" 
    1.22 +	href="https://twitter.com/${TWITTER_USER}">Tweets by ${TWITTER_USER}</a> 
    1.23 +<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
    1.24 +EOT
    1.25 +		html_footer && exit 0 ;;
    1.26 +	
    1.27  	*\ community\ *)
    1.28  		d="Community Tools"
    1.29  		header
    1.30 @@ -98,6 +109,7 @@
    1.31  		fi
    1.32  		cat << EOT
    1.33  <a href="$script?wall">Community Wall</a>
    1.34 +<a href="$script?twitter">Twitter Timeline</a>
    1.35  </div>
    1.36  <h2>$d</h2>
    1.37  <p>$SHORT_DESC</p>
    1.38 @@ -106,8 +118,9 @@
    1.39  			cat << EOT
    1.40  <h3>Plugin config</h3>
    1.41  <pre>
    1.42 -Wall mode        : $WALL_MODE
    1.43 -Messages length  : $WALL_MESSAGES_LENGTH
    1.44 +Wall mode          : $WALL_MODE
    1.45 +Messages length    : $WALL_MESSAGES_LENGTH
    1.46 +Twitter user       : $TWITTER_USER
    1.47  </pre>
    1.48  EOT
    1.49  		fi
     2.1 --- a/plugins/community/community.conf	Fri Feb 17 13:56:41 2017 +0100
     2.2 +++ b/plugins/community/community.conf	Sun Feb 19 23:46:04 2017 +0100
     2.3 @@ -11,5 +11,8 @@
     2.4  # Wall mode: public/private
     2.5  WALL_MODE="public"
     2.6  
     2.7 -# Max length for messages on the Wall.
     2.8 +# Max length for messages on the Wall
     2.9  WALL_MESSAGES_LENGTH="240"
    2.10 +
    2.11 +# Twitter account user name 
    2.12 +TWITTER_USER="slitaz"