This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def calendars | |
| @feed = Resources::FeedSource.find params[:feed_code] | |
| @all = Nosql::StationCalendars::All.new(@feed) | |
| @featured = Nosql::StationCalendars::Featured.new(@feed) | |
| @dayparts = Nosql::StationCalendars::Dayparts.new(@feed) | |
| @dayparts_default = Nosql::StationCalendars::DaypartsDefault.new(@feed) | |
| @playlist = Nosql::StationCalendars::Playlist.new(@feed) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module MobileApps | |
| module ToPortalApp | |
| def to_portal_app(mobile_app_id) | |
| @mobile_app = MobileApp.find(mobile_app_id) | |
| @mobile_app.enable_search | |
| @mobile_app.insert_menu_items | |
| @mobile_app.has_my_stations_menu | |
| @mobile_app.has_clip_feed_set |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe "DELETE destroy" do | |
| before { ContentSource.stub(:find).with("999").and_return(source) } | |
| let(:source) { double(:source) } | |
| it "it succeeds with a 204" do | |
| delete :destroy, :id => 999, :format => :json | |
| response.status.should eq(204) | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def calendars | |
| @feed = Resources::FeedSource.find params[:feed_code] | |
| @all = Nosql::StationCalendars::All.new(@feed) | |
| @featured = Nosql::StationCalendars::Featured.new(@feed) | |
| @dayparts = Nosql::StationCalendars::Dayparts.new(@feed) | |
| @dayparts_default = Nosql::StationCalendars::DaypartsDefault.new(@feed) | |
| @playlist = Nosql::StationCalendars::Playlist.new(@feed) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'spec_helper' | |
| module Admin | |
| module RequestHandlers | |
| describe FeedCalendar do | |
| let(:handler) { Admin::RequestHandlers::FeedCalendar.new params } | |
| let(:params) { {:feed_code => feed_code, :feed => feed} } | |
| let(:feed_code) {"KINK-FM"} | |
| let(:feed) { Resources::FeedSource.find(params[:feed_code]) } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def cancel_promotion?(options) | |
| # don't cancel if there is a stunt clip | |
| return false if options[:clip_response] | |
| # binding.pry | |
| @xml = get_xml(options[:content_source]) | |
| @items = @xml.items | |
| @items.blank? | |
| rescue NoMethodError | |
| Rails.logger.error "Web feed with no items? for content source #{options[:content_source].id}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_post(options) | |
| #KINK: 20805436 | |
| user_id = options[:content_source].content_source_id | |
| if $redis.get(:twitter_request_error) == true | |
| false | |
| elsif user_id.present? == false | |
| Rails.logger.error "#{options[:content_source].name} does not have an twitter_id. Please add it to enable the TwitterFeed behavior" | |
| false | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class At_rot13 | |
| @rot_cipher = {"A" => "N", "B" => "O", "C" => "P", "D" => "Q", "E" => "R", "F" => "S", "G" => "T", "H" => "U", "I" => "V", "J" => "W", "K" => "X", "L" => "Y", "M" => "Z", "N" => "A", "O" => "B", "P" => "C", "Q" => "D", "R" => "E", "S" => "F", "T" => "G", "U" => "H", "V" => "I", "W" => "J", "X" => "K", "Y" => "L", "Z" => "M", "a" => "n", "b" => "o", "c" => "p", "d" => "q", "e" => "r", "f" => "s", "g" => "t", "h" => "u", "i" => "v", "j" => "w", "k" => "x", "l" => "y", "m" => "z", "n" => "a", "o" => "b", "p" => "c", "q" => "d", "r" => "e", "s" => "f", "t" => "g", "u" => "h", "v" => "i", "w" => "j", "x" => "k", "y" => "l", "z" => "m", " " => " "} | |
| def self.rot_13(string, rot_cipher) | |
| string.chars.map { |x| rot_cipher[x]}.join('') | |
| end | |
| def self.encrypt_decrypt(string) | |
| rot_13(string, @rot_cipher) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module List | |
| def self.ordered_frequency(file) | |
| file_text = open(file).read.gsub(/[\\\"]/,"") | |
| text_array = file_text.split(/\n/) | |
| ordered_frequency = Hash.new(0) | |
| text_array.each { |column| ordered_frequency.store(column, ordered_frequency[column]+1) } | |
| File.open("ordered_frequency_count.txt", "w") {|f| f.write( ordered_frequency.sort_by {|k,v| v}.reverse.to_h ) } | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "I like cats" | |
| "I like dogs" | |
| "I like dogs" | |
| "I like dogs" | |
| "I like dogs" | |
| "I like cats" | |
| "I like cats" | |
| "I like cats" |
OlderNewer