2017 © Pedro PelĂĄez
 

library twitter-activity

Simple PHP Twitter User Activity Checker

image

danvin-test/twitter-activity

Simple PHP Twitter User Activity Checker

  • Friday, June 8, 2018
  • by affiliate54
  • Repository
  • 0 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Simple PHP Twitter User Activity Checker (based on Silex 2.3, Twitter API v1.1)

This small web app takes user's twitter screen name as a parameter and return a JSON-encoded array containing "hour -> tweets count" for a given user, to determine what hour of the day they are most active. It also provides demonstration of the Silex's routing., (*1)

Requirements

  1. PHP 7.1.3 or later
  2. Enabled PHP CURL module
  3. Enabled mod_rewrite module (only for usage on webserver)

Installation

  1. Install Composer, (*2)

    curl -s https://getcomposer.org/installer | php
  2. Execute, (*3)

    php composer.phar create-project danvin-test/twitter-activity project_name

Configuration

Twitter API Credentials, (*4)

Edit config.json, located in the root folder of the project, to set up your Twitter API credentials., (*5)

Notable mention: This web app uses statuses/user_timeline Twitter API. Advanced configuration available in the config.json, under twitterRequestSettings section., (*6)

.htaccess, (*7)

If your site is not at the webroot level you will have to uncomment the RewriteBase statement and adjust the path to point to your directory, relative from the webroot. More information available at the Silex Webserver Configuration page, (*8)

Usage

The application has 3 endpoints: 1. "/" - will respond with "Try /hello/:name" as text 2. "/hello/Daniel" - will respond with “Hello Daniel” as text 3. "/histogram/Ferrari" - will respond with a JSON-encoded array displaying the number of tweets per hour of the day. Most active hours will be presented at the top of the array., (*9)

CLI, (*10)

php index.php GET /                            
php index.php GET /hello/Daniel
php index.php GET /histogram/Ferrari

WebServer, (*11)

http://localhost/
http://localhost/hello/daniel
http://localhost/histogram/Ferrari

Running the tests

  1. Make sure you have PHPUnit installed.
  2. To execute the tests, navigate into your project's folder and run, (*12)

    phpunit

Built With

  1. Silex
  2. twitter-api-php

The Versions

08/06 2018

dev-master

9999999-dev

Simple PHP Twitter User Activity Checker

  Sources   Download

MIT

The Requires

 

08/06 2018

1.1

1.1.0.0

Simple PHP Twitter User Activity Checker

  Sources   Download

MIT

The Requires

 

08/06 2018

1.0

1.0.0.0

Simple PHP Twitter User Activity Checker

  Sources   Download

MIT

The Requires