├── ritetag_analysis-1.0.1.gem ├── ritetag_analysis.gemspec ├── LICENSE ├── lib └── ritetag_analysis.rb └── README.md /ritetag_analysis-1.0.1.gem: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdiChat/ritetag_analysis/master/ritetag_analysis-1.0.1.gem -------------------------------------------------------------------------------- /ritetag_analysis.gemspec: -------------------------------------------------------------------------------- 1 | Gem::Specification.new do |s| 2 | s.name = 'ritetag_analysis' 3 | s.version = '1.0.1' 4 | s.date = '2016-02-03' 5 | s.summary = "The ritetag_analysis gem provides the ruby interface required for extensive hashtag analysis for effective social media optimization. It is based upon the ritetag API." 6 | s.description = "A gem for hashtag analysis for social media optimization" 7 | s.authors = ["Aditya Chatterjee"] 8 | s.email = 'aditianhacker@gmail.com' 9 | s.files = ["lib/ritetag_analysis.rb"] 10 | s.homepage = 11 | 'http://rubygems.org/gems/ritetag_analysis' 12 | s.license = 'MIT' 13 | end 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Aditya Chatterjee 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /lib/ritetag_analysis.rb: -------------------------------------------------------------------------------- 1 | require 'oauth' 2 | require 'json' 3 | require 'rest_client' 4 | 5 | class RiteTag_Analysis 6 | 7 | def initialize(auth) 8 | @auth = auth 9 | @consumer=OAuth::Consumer.new @auth['consumer_key'], @auth['consumer_secret'], {:site=>"http://ritetag.com/api/v2"} 10 | @access_token = OAuth::AccessToken.new(@consumer, @auth['token'], @auth['token_secret']) 11 | end 12 | 13 | def statistics(query) 14 | response = RestClient.get 'https://ritetag.com/api/v2.2/data/stats/#{query}' 15 | response_json = JSON.pase(respone) 16 | puts response_json["stats"] 17 | end 18 | 19 | def formatted_stat(hashtag, parameter = "associatedHashtags", term = 1, section = "tags") 20 | response = RestClient.get 'https://ritetag.com/api/v2.2/data/stats/#{hashtag}' 21 | response_json = JSON.pase(respone) 22 | puts response_json["associatedHashtags"][1]["tags"] 23 | end 24 | 25 | def trending(query1 = 'green', query2) 26 | response = RestClient.get 'https://ritetag.com/api/v2.2/data/trending/?#{query1}=0&#{query2}=0' 27 | response_json = JSON.pase(respone) 28 | puts response_json 29 | end 30 | 31 | def influencers(query) 32 | response = RestClient.get 'https://ritetag.com/api/v2.2/influencers/#{query}' 33 | response_json = JSON.pase(respone) 34 | puts response_json 35 | end 36 | 37 | def history(query) 38 | response = RestClient.get 'https://ritetag.com/api/v2.2/history/#{query}' 39 | response_json = JSON.pase(respone) 40 | puts response_json 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # :gem: RiteTag Analysis :star: 2 | [![Gem Version](https://badge.fury.io/rb/ritetag_analysis.svg)](https://badge.fury.io/rb/ritetag_analysis) [![License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](http://badges.mit-license.org) 3 | ![alt text](https://img.shields.io/badge/ritetag__analysis-good-green.svg " Profile Bin") 4 | 5 | A gem for Social Media Optimization.
6 | This gem will be upgraded frequently thereby incorporating more useful methods aiding in extensive hashtag analysis.
7 | Find the gem [here](https://rubygems.org/gems/ritetag_analysis). 8 | 9 | ## Installation 10 | 11 | Add the gem to the gemfile: 12 | 13 | ```ruby 14 | gem 'ritetag_analysis' 15 | ``` 16 | 17 | Then execute: 18 | ```ruby 19 | $ bundle install 20 | ``` 21 | Install the gem : 22 | 23 | ```ruby 24 | $ gem install ritetag_analysis 25 | ``` 26 | 27 | ## Usage 28 | 29 | Create a hash containing the oAuth parameters. 30 | 31 | ```ruby 32 | authorization = { 33 | 'consumer_key' => 'CONSUMER KEY', 34 | 'consumer_secret' => 'CONSUMER SECRET KEY', 35 | 'token' => 'TOKEN KEY', 36 | 'token_secret' => 'TOKEN SECRET KEY' 37 | } 38 | ``` 39 | 40 | 41 | Create an object : 42 | ```ruby 43 | analyse = RiteTag_Analysis.new(authorization) 44 | ``` 45 | 46 | In order to use a method( say: trending() ) 47 | 48 | ```ruby 49 | analyse.trending('green','internship') 50 | ``` 51 | It would reveal the associated hashtags related to internship that has the perfect balance of exposure and retweets.
52 | 53 | All the other useful methods are used to get various information regarding user given hashtags 54 | 55 | ## Author 56 | The gem ritetag_analysis has been coded by [Aditya Chatterjee](http://github.com/AdiChat). 57 | 58 | ## Contribute :pray: 59 | 60 | Bug reports and pull requests are welcomed. Feel free to add me. 61 | 62 | ## License 63 | 64 | The gem is available as open source project under the terms of the [MIT License](https://github.com/AdiChat/ritetag_analysis/blob/master/LICENSE). 65 | --------------------------------------------------------------------------------