Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

first commit

  • Loading branch information...
commit 73ccdfd4bfe6e277319ced0a8b3a97cc9581acf9 0 parents
@carimura carimura authored
1  .idea/.name
@@ -0,0 +1 @@
+sfbeta
5 .idea/encodings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
+</project>
+
12 .idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,12 @@
+<component name="InspectionProjectProfileManager">
+ <profile version="1.0" is_locked="false">
+ <option name="myName" value="Project Default" />
+ <option name="myLocal" value="false" />
+ <inspection_tool class="RubyUnusedLocalVariable" enabled="true" level="INFO" enabled_by_default="true" />
+ <inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
+ <option name="processCode" value="true" />
+ <option name="processLiterals" value="true" />
+ <option name="processComments" value="true" />
+ </inspection_tool>
+ </profile>
+</component>
7 .idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,7 @@
+<component name="InspectionProjectProfileManager">
+ <settings>
+ <option name="PROJECT_PROFILE" value="Project Default" />
+ <option name="USE_PROJECT_PROFILE" value="true" />
+ <version value="1.0" />
+ </settings>
+</component>
26 .idea/misc.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectDictionaryState">
+ <dictionary name="carimura" />
+ </component>
+ <component name="ProjectRootManager" version="2" project-jdk-name="Ruby SDK (/usr/local/bin/ruby)" project-jdk-type="RUBY_SDK" />
+ <component name="SvnConfiguration" maxAnnotateRevisions="500">
+ <option name="USER" value="" />
+ <option name="PASSWORD" value="" />
+ <option name="mySSHConnectionTimeout" value="30000" />
+ <option name="mySSHReadTimeout" value="30000" />
+ <option name="LAST_MERGED_REVISION" />
+ <option name="MERGE_DRY_RUN" value="false" />
+ <option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
+ <option name="UPDATE_LOCK_ON_DEMAND" value="false" />
+ <option name="IGNORE_SPACES_IN_MERGE" value="false" />
+ <option name="DETECT_NESTED_COPIES" value="false" />
+ <option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
+ <option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
+ <option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
+ <option name="FORCE_UPDATE" value="false" />
+ <configuration useDefault="true">$USER_HOME$/.subversion</configuration>
+ <myIsUseDefaultProxy>false</myIsUseDefaultProxy>
+ </component>
+</project>
+
9 .idea/modules.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectModuleManager">
+ <modules>
+ <module fileurl="file://$PROJECT_DIR$/.idea/sfbeta.iml" filepath="$PROJECT_DIR$/.idea/sfbeta.iml" />
+ </modules>
+ </component>
+</project>
+
5 .idea/scopes/scope_settings.xml
@@ -0,0 +1,5 @@
+<component name="DependencyValidationManager">
+ <state>
+ <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+ </state>
+</component>
9 .idea/sfbeta.iml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="RUBY_MODULE" version="4">
+ <component name="NewModuleRootManager">
+ <content url="file://$MODULE_DIR$" />
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ </component>
+</module>
+
7 .idea/vcs.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="VcsDirectoryMappings">
+ <mapping directory="" vcs="" />
+ </component>
+</project>
+
282 .idea/workspace.xml
@@ -0,0 +1,282 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ChangeListManager">
+ <list default="true" id="0511f4f0-e417-4541-9f03-7db4cea5c6de" name="Default" comment="" />
+ <ignored path="sfbeta.iws" />
+ <ignored path=".idea/workspace.xml" />
+ <option name="TRACKING_ENABLED" value="true" />
+ <option name="SHOW_DIALOG" value="false" />
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+ <option name="LAST_RESOLUTION" value="IGNORE" />
+ </component>
+ <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
+ <component name="CreatePatchCommitExecutor">
+ <option name="PATCH_PATH" value="" />
+ </component>
+ <component name="DaemonCodeAnalyzer">
+ <disable_hints />
+ </component>
+ <component name="FavoritesManager">
+ <favorites_list name="sfbeta" />
+ </component>
+ <component name="FileEditorManager">
+ <leaf>
+ <file leaf-file-name="hit_action.rb" pinned="false" current="true" current-in-tab="true">
+ <entry file="file://$PROJECT_DIR$/hit_action.rb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="4" column="28" selection-start="125" selection-end="125" vertical-scroll-proportion="0.11162791">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="stream_analyzer.rb" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/stream_analyzer.rb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="25" column="44" selection-start="762" selection-end="762" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="queue.rb" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/queue.rb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="2" column="40" selection-start="66" selection-end="66" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="upload.rb" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/upload.rb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="2" column="40" selection-start="66" selection-end="66" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ </leaf>
+ </component>
+ <component name="IdeDocumentHistory">
+ <option name="changedFiles">
+ <list>
+ <option value="$PROJECT_DIR$/stream_analyzer.rb" />
+ <option value="$PROJECT_DIR$/queue.rb" />
+ <option value="$PROJECT_DIR$/upload.rb" />
+ <option value="$PROJECT_DIR$/hit_action.rb" />
+ </list>
+ </option>
+ </component>
+ <component name="ProjectFrameBounds">
+ <option name="x" value="4" />
+ <option name="y" value="22" />
+ <option name="width" value="1362" />
+ <option name="height" value="746" />
+ </component>
+ <component name="ProjectLevelVcsManager" settingsEditedManually="false">
+ <OptionsSetting value="true" id="Add" />
+ <OptionsSetting value="true" id="Remove" />
+ <OptionsSetting value="true" id="Checkout" />
+ <OptionsSetting value="true" id="Update" />
+ <OptionsSetting value="true" id="Status" />
+ <OptionsSetting value="true" id="Edit" />
+ <ConfirmationsSetting value="0" id="Add" />
+ <ConfirmationsSetting value="0" id="Remove" />
+ </component>
+ <component name="ProjectReloadState">
+ <option name="STATE" value="0" />
+ </component>
+ <component name="ProjectView">
+ <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
+ <flattenPackages />
+ <showMembers />
+ <showModules />
+ <showLibraryContents />
+ <hideEmptyPackages />
+ <abbreviatePackageNames />
+ <autoscrollToSource />
+ <autoscrollFromSource />
+ <sortByType />
+ </navigator>
+ <panes>
+ <pane id="Scope">
+ <subPane subId="Project Files">
+ <PATH>
+ <PATH_ELEMENT USER_OBJECT="Root">
+ <option name="myItemId" value="" />
+ <option name="myItemType" value="" />
+ </PATH_ELEMENT>
+ </PATH>
+ </subPane>
+ </pane>
+ <pane id="ProjectPane">
+ <subPane>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sfbeta" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sfbeta" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sfbeta" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ </subPane>
+ </pane>
+ </panes>
+ </component>
+ <component name="PropertiesComponent">
+ <property name="options.splitter.main.proportions" value="0.3" />
+ <property name="WebServerToolWindowFactoryState" value="false" />
+ <property name="options.lastSelected" value="project.propVCSSupport.VCSs.Git" />
+ <property name="options.searchVisible" value="true" />
+ <property name="options.splitter.details.proportions" value="0.2" />
+ </component>
+ <component name="RunManager">
+ <configuration default="true" type="RubyRunConfigurationType" factoryName="Ruby">
+ <module name="" />
+ <RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
+ <RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="" />
+ <RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
+ <RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
+ <RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
+ <envs />
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
+ <COVERAGE_PATTERN ENABLED="true">
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
+ </COVERAGE_PATTERN>
+ </EXTENSION>
+ <RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="" />
+ <RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
+ <method>
+ <option name="RakeTask" enabled="false" />
+ </method>
+ </configuration>
+ <list size="0" />
+ </component>
+ <component name="ShelveChangesManager" show_recycled="false" />
+ <component name="TaskManager">
+ <task active="true" id="Default" summary="Default task">
+ <created>1332829309969</created>
+ <updated>1332829309969</updated>
+ </task>
+ <servers />
+ </component>
+ <component name="ToolWindowManager">
+ <frame x="4" y="22" width="1362" height="746" extended-state="0" />
+ <editor active="true" />
+ <layout>
+ <window_info id="Data Sources" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
+ <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
+ <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
+ <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24961948" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
+ <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+ <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
+ <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
+ <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
+ <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
+ <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+ <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+ <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+ <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+ <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
+ <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
+ </layout>
+ </component>
+ <component name="VcsContentAnnotationSettings">
+ <option name="myLimit" value="2678400000" />
+ </component>
+ <component name="VcsManagerConfiguration">
+ <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
+ <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
+ <option name="CHECK_NEW_TODO" value="true" />
+ <option name="myTodoPanelSettings">
+ <value>
+ <are-packages-shown value="false" />
+ <are-modules-shown value="false" />
+ <flatten-packages value="false" />
+ <is-autoscroll-to-source value="false" />
+ </value>
+ </option>
+ <option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
+ <option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
+ <option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
+ <option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
+ <option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
+ <option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
+ <option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="true" />
+ <option name="ENABLE_BACKGROUND_PROCESSES" value="false" />
+ <option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
+ <option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
+ <option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
+ <option name="DEFAULT_PATCH_EXTENSION" value="patch" />
+ <option name="SHORT_DIFF_HORISONTALLY" value="true" />
+ <option name="SHORT_DIFF_EXTRA_LINES" value="2" />
+ <option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
+ <option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
+ <option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
+ <option name="CREATE_PATCH_EXPAND_DETAILS_DEFAULT" value="true" />
+ <option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
+ <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
+ <option name="LAST_COMMIT_MESSAGE" value="* Initial commit" />
+ <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="true" />
+ <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
+ <option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
+ <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
+ <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
+ <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
+ <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
+ <option name="ACTIVE_VCS_NAME" />
+ <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
+ <option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
+ <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
+ <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
+ <MESSAGE value="* Initial commit" />
+ </component>
+ <component name="XDebuggerManager">
+ <breakpoint-manager />
+ </component>
+ <component name="editorHistoryManager">
+ <entry file="file://$PROJECT_DIR$/upload.rb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="2" column="40" selection-start="66" selection-end="66" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/queue.rb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="2" column="40" selection-start="66" selection-end="66" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/stream_analyzer.rb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="25" column="44" selection-start="762" selection-end="762" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/hit_action.rb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="4" column="28" selection-start="125" selection-end="125" vertical-scroll-proportion="0.11162791">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </component>
+</project>
+
1  README
@@ -0,0 +1 @@
+For SF Beta Demo Purposes
6 hit_action.rb
@@ -0,0 +1,6 @@
+require 'hipchat-api'
+
+log "I'm doing something with params #{@params.inspect}"
+r = @params['r']
+hipchat = HipChat::API.new('')
+hipchat.rooms_message("Test Room", 'SF Beta Bot', "@#{r['from_user']} says: #{r['text']}", false).body
4 queue.rb
@@ -0,0 +1,4 @@
+require 'iron_worker_ng'
+
+client = IronWorkerNG::Client.new('','')
+client.tasks.create('StreamAnalyzer')
32 stream_analyzer.rb
@@ -0,0 +1,32 @@
+require 'iron_worker_ng'
+require 'rest-client'
+require 'active_support/core_ext'
+
+kw = "voteiron"
+x=duration=0
+start_time = Time.now
+all = @params['found_tweets'] || []
+log "Starting worker with params #{@params.inspect}"
+
+while (true)
+ results = RestClient.get "http://search.twitter.com/search.json?q=#{kw}%20since:#{Time.now.strftime("%Y-%m-%d")}"
+ results = JSON.parse(results)
+
+ # Found Keyword
+ results['results'].each_with_index do |r, i|
+ all.include?(r['id_str']) ? next : all << r['id_str']
+ client = IronWorkerNG::Client.new('','')
+ client.tasks.create('HitAction', 'r' => r)
+ end
+
+ duration = (Time.now - start_time).round(1)
+ puts "Total Duration: #{duration} seconds"
+
+ if duration > 60
+ client = IronWorkerNG::Client.new('','')
+ client.tasks.create('StreamAnalyzer', 'found_tweets' => all)
+ break
+ end
+
+ sleep 1
+end
14 upload.rb
@@ -0,0 +1,14 @@
+require 'iron_worker_ng'
+
+client = IronWorkerNG::Client.new('','')
+master_code = IronWorkerNG::Code::Ruby.new
+master_code.merge_worker 'stream_analyzer.rb'
+master_code.merge_gem 'rest-client'
+master_code.merge_gem 'activesupport'
+master_code.merge_gem 'iron_worker_ng'
+client.codes.create(master_code)
+
+slave_code = IronWorkerNG::Code::Ruby.new
+slave_code.merge_worker 'hit_action.rb'
+slave_code.merge_gem 'hipchat-api'
+client.codes.create(slave_code)

0 comments on commit 73ccdfd

Please sign in to comment.
Something went wrong with that request. Please try again.