Giter VIP home page Giter VIP logo

twitter-public-timeline-for-oracle's Introduction

Twitter Public timeline for Oracle

Provides a view for Oracle database that fetches and returns tweets from Twitter public timeline. You can SELECT Twitter public timeline as below:

SELECT created_at, screen_name, text FROM TWITTER_PUBLIC_TIMELINE WHERE LOWER(text) LIKE '%http%';

Note that this library will not work on Twitter API v1.1 because of dropping XML support and requiring authentication with OAuth.
This library gets timeline with XML API and is not authenticated.

Requirement

  • Oracle Database 11g Release 2
    • Tested on 11g R2 Express Edition for Linux x64

Install

1. Setup UTL_HTTP package

Execute $ORACLE_HOME/rdbms/admin/utlhttp.sql to enable UTL_HTTP package.
Run the following commands in the shell on your DB server.

$ cd $ORACLE_HOME/rdbms/admin
$ sqlplus SYS/YOUR-PASSWORD@localhost:1521/XE AS SYSDBA @utlhttp.sql

2. Setup the network Access Control List (ACL)

On Oracle 11g, the network access configuration is required to use UTL_HTTP package.

The following code is an example to grant the connect and resolve privileges for host api.twitter.com to user SCOTT.
Replace 'SCOTT' to your user name and run the following codes in SQL*Plus.

DECLARE
  user VARCHAR2(30) := 'SCOTT'; -- *Enter your user name*
BEGIN
  DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('www.xml', 'WWW ACL', user, TRUE, 'connect');
  DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE('www.xml', user, TRUE, 'resolve');
  DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('www.xml', 'api.twitter.com');
END;

For more information, see this document.

3. Install Twitter Public timeline for Oracle

Execute install.sql.
Run the following commands in the shell on your DB server.

$ sqlplus YOUR-USER-NAME/YOUR-PASSWORD@localhost:1521/XE @install.sql

Usage

Query to TWITTER_PUBLIC_TIMELINE view.

SELECT created_at, screen_name, text FROM TWITTER_PUBLIC_TIMELINE;

Columns of TWITTER_PUBLIC_TIMELINE is the following.

IDNUMBER
CREATED_ATTIMESTAMP(6)
TEXTVARCHAR2(1000)
SOURCEVARCHAR2(1000)
TRUNCATEDVARCHAR2(5)
FAVORITEDVARCHAR2(5)
IN_REPLY_TO_STATUS_IDNUMBER
IN_REPLY_TO_USER_IDNUMBER
IN_REPLY_TO_SCREEN_NAMEVARCHAR2(100)
RETWEET_COUNTNUMBER
RETWEETEDVARCHAR2(5)
USER_IDNUMBER
USER_NAMEVARCHAR2(100)
SCREEN_NAMEVARCHAR2(100)

Uninstall

Run uninstall.sql.

$ sqlplus YOUR-USER-NAME/YOUR-PASSWORD@localhost:1521/XE @uninstall.sql

License

This project is released under the MIT license:
http://opensource.org/licenses/MIT

twitter-public-timeline-for-oracle's People

Contributors

ser1zw avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.