Download the PHP package micmania1/sstwitter without Composer

On this page you can find all versions of the php package micmania1/sstwitter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sstwitter

SSTwitter

SSTwitter is a Silverstripe module to allow simple integration between Twitter & Silverstripe.

Features

Usage

$TwitterConnectURL (TwitterApp::connect_url()) This displays a link where a logged in user will be taken through the Twitter authentication process to connect their Twitter account.

$TwitterDisconnectURL (TwitterApp::disconnect_url()) This will disassociate the Twitter account from the Member.

$TwitterLoginURL (TwitterApp::login_url()) This will return a url whereby the user can login to their Silverstripe account through Twitter where previously connected.

<a href="$TwitterConnectURL">Connect</a><br />
<a href="$TwitterDisconnectURL">Disconnect</a><br />
<% if TwitterLoginURL %>
    <a href="$TwitterLoginURL">Login</a>
<% else %>
    Twitter Login is disabled.
<% end_if %>

Extending

SSTwitter uses PHPTwitter for its Twitter Authentication which has a central Twitter->api() method which handles all API requests. This means you can easily harness its power to interact directly with Twitter. Below is an example of how you would get the latest tweets for the account connected to your website.

In Page_Controller.php:

public function LatestTweets($count = 3) {

    $tweets = new ArrayList();

    $twitterApp = TwitterApp::get()->first();
    $twitter = $twitterApp->getTwitter(); // Access the PHPTwitter interface
    $twitter->setAccess(new OauthToken($twitterApp->TwitterAccessToken, $twitterApp->TwitterAccessSecret));

    // Get the latest Tweets
    if($twitter->hasAccess()) {
        $result = $twitter->api("1.1/statuses/user_timeline.json", "GET", array(
            "screen_name" => $twitterApp->TwitterScreenName,
            "count" => (int) $count
        ));

        if($result->statusCode() == 200) {
            $json = json_decode($result->body(), true);
            if(count($json) > 0) {
                foreach($json as $tweet) {
                    $tweets->push(ArrayData::create(array(
                        "Tweet" => $tweet['text'],
                        "Created" => $tweet['created_at'],
                        "Link" => "http://www.twitter.com/".rawurlencode($tweet['user']['screen_name'])."/status/".rawurlencode($tweet['id_str'])
                    )));
                }
            }
        }
    }
    return $tweets;
}

In Page.ss

<% if LatestTweets %>
    <ul>
        <% loop LatestTweets %>
            <li>$Tweet - <a href="$Link">$Created</a></li>
        <% end_loop %>
    </ul>
<% end_if %>

All versions of sstwitter with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package micmania1/sstwitter contains the following files

Loading the files please wait ....