ginatrapani/ThinkUp — pull request #1518 by ecucurella (2013-03-26 11:08:01+00:00)
Title: Adding support for hashtag or keyword search

# Introduction
Twitter hashtags search collects all tweets from Twitter API 1.1 tweets/search
that contain keyword or hashtag specified related to a twitter account.

## User interface:
* A twitter account can add hashtags or keywords to be searched
* A twitter account can delete hashtags or keywords from being searched
* View how many hashtags or keywords are being searched and how many tweets have been saved for each one

Screenshot for Twitter Plugin settings:
![ThinkUp_TwitterSettings](https://f.cloud.github.com/assets/570816/302353/e2d62008-9603-11e2-8dd3-b19b6b1359f0.jpg)

Screenshot for Twitter Plugin Search settings:
![ThinkUp_TwitterSearchTweetsSettings](https://f.cloud.github.com/assets/570816/302351/d6e5c00a-9603-11e2-8e57-e9023fd2db77.jpg)

## Twitter Crawler
We have added tweets search for all hashtag or keyword related to every instance

## POST API
We have added a new type for POST API named hashtag_posts to get posts that contain a hashtag or keyword.

# What are we working now?
Now, we are working on SearchController to add view of this posts in the Insights

# Changes

## Docs

* Added documentation for new Exception in POST API HashtagNotFoundException
* Added documentation for new type of POST API *hashtag_posts*
* Added documentation for Twitter hashtags or Keyword search
* Modified some index to add new documentation

## Tests

* Added TestOfHashtagPostMySQLDAO
* Added TestOfInstanceHashtagMySQLDAO
* Modified TestOfAccountConfigurationController, new test
* Modified TestOfDAOFactory, modified assertEqual for increase number of tables in database
* Modified TestOfHashtagMySQLDAO, added new test and modified some test with change of buildata
* Modified TestOfInstaller, adding new table instances_hashtags
* Modified TestOfInstallerMySQLDAO, modified assertEqual for increase number of tables in database
* Modified TestOfLinkMySQLDAO, new test
* Modified TestOfPostAPIController, new test
* Modified TestOfPostMySQLDAO, new test and modified some test with change of buildata
* Modified TestOfReporter, modification to pass test
* Modified TestOfUserMySQLDAO, new test
* Modified WebTestOfDeleteInstance, set configuration for proxy options
* Modified WebTestOfUpgradeDatabase, set configuration for proxy options

## Webapp
* Modified config.sample.inc.php with new commented values in TEST MODE for invalid_host, requires_proxy and proxy

### lib
* Modified class DAOFactory adding new pair of key, value in DAO mapping
* Modified class Installer to solve one test fail

#### controller
* Modified class AccountConfigurationController to be able to:
** add new hashtag or keyword search
** delete a hashtag or keyword search
** delete all hashtag or keyword searches from an instance when this instance is deleted
** render configuration view for hashtag or keyword search
* Modified class PostAPICOntroller, adding a new type named hashtag_posts to get posts with a hashtag or keyword

#### dao
* Added class HashtagPostMySQLDAO that extends from HashtagMySQLDAO and overwrites insertHashtag
* Added class InstanceHashtagMySQLDAO that implement interface InstanceHashtagDAO
* Added interface InstanceHashtagDAO
* Modified class HashtagMySQLDAO, add new public functions
* Modified interface HashtagDAO
* Modified class LinkMySQLDAO, add new public function
* Modified interface LinkDAO
* Modified class PostMySQLDAO, add new public function
* Modified interface PostDAO
* Modified class UserMySQLDAO, add new public function
* Modified interface UserDAO

#### exceptions
* Added class HashtagNotFoundException that extends from Exception

#### model
* Added class Hashtag
* Added class HashtagPost
* Added class InstanceHashtag

### install

#### sql
* Generated with script migratedb file build-db_mysql.sql

##### mysql_migrations
* Added new sql file to create table tu_instances_hashtags

### plugins

#### twitter

##### controller
* Added class TwitterPluginHashtagConfigurationController for view configuration of hashtag or keyword search
* Modified class TwitterAuthController to add configuration of proxy values
* Modified class TwitterPluginConfigurationController to add options for configure proxy settings in Twitter Plugin Configuration

##### extlib

###### twitteroauth
* Modified twitteroauth http function to set options for proxy in curl

##### model
* Modified class CrawlerTwitterAPIAccessorOAuth to:
** add proxy settings
** add search in resources string to initialize Rate limit
* Modified class TwitterAPIAccessorOAuth to:
** add proxy settings
** add search/tweets in api_method array
* add function parseJSONTweetsFromSearch
* Modified class TwitterCrawler, added function fetchInstanceHashtagTweets
* Modified class TwitterOAuthThinkUp, added setProxy function
* Modified class TwitterPlugin, modified crawl function to call fetchInstanceHashtagTweets for each instance_hashtag relation

##### tests
* Modified TestOfTwitterAPIAccessorOAuth, new test
* Modified TestOfTwitterAuthController for proxy settings
* Modified TestOfTwitterCrawler, new tests
* Modified TestOfTwitterPlugin for proxy settings

###### testdata
* Add application_rate_limit_status.json-resources=account,statuses,users,followers,lists,friends,favorites,friendships,application,search
* Add json/search_tweets.json
* Add testofcrawlertwitterapiaccessoroauth/testinitializeendpointratelimits/application_rate_limit_status.json-resources=account,statuses,users,followers,lists,friends,favorites,friendships,application,search

##### view
* Add twitter.account.hashtag.tpl for hashtag or keyword search settings
* Modified twitter.hashtag.tpl for adding button to configure hashtag or keyword search settings

Powered by Televisió de Catalunya / Universitat Illes Balears - SOCIALMEDIA PROJECT - CEN-20101037 - This contribution has been kindly sponsored by the Centro para el Desarrollo Tecnológico Industrial within the Programa de Investigación Nacional Español CENIT. - http://www.cenitsocialmedia.es/