This file contains 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
# frozen_string_literal: true | |
module DiscourseAi | |
module Automation | |
class ReportContextGenerator | |
def self.generate( | |
start_date:, | |
duration:, | |
category_ids: nil, | |
tags: nil, |
This file contains 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
#!/usr/bin/env ruby | |
require "curses" | |
require "fileutils" | |
require "open-uri" | |
require "shellwords" | |
plugin_dir = File.expand_path("~/Source/discourse/plugins") | |
disabled_plugin_dir = File.expand_path("~/Source/discourse-plugins") |
This file contains 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
title: | |
The name of this site. Visible to all visitors including anonymous users. | |
------ | |
The name of the community or site as displayed on browsers' title bars, in emails, and across various areas of the site. This name is also publicly visible to all users including guests. | |
site_description: | |
Describe this site in one sentence. Visible to all visitors including anonymous users. | |
------ | |
Provide a concise summary of your site's purpose that will be visible to everyone, including those who are not logged in. |
This file contains 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 "net/http" | |
require "uri" | |
require "json" | |
require "yaml" | |
require "open3" | |
DISCOURSE_ROOT = "/home/sam/Source/discourse" | |
API_KEY = ENV["OPENAI_API_KEY"] | |
def openai_chat_completion(system_prompt, prompt) |
This file contains 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
#!/usr/bin/env ruby | |
require "curses" | |
require "fileutils" | |
require "open-uri" | |
require "shellwords" | |
plugin_dir = File.expand_path("~/Source/discourse/plugins") | |
disabled_plugin_dir = File.expand_path("~/Source/discourse-plugins") |
This file contains 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
notifications(topic_id,created_at,updated_at,post_action_id,id,data,high_priority,read,user_id,notification_type,post_number) | |
posts(raw_email,reply_to_user_id,created_at,percent_rank,raw,hidden_reason_id,spam_count,user_id,via_email,image_upload_id,word_count,illegal_count,like_count,hidden_at,baked_version,deleted_by_id,id,baked_at,inappropriate_count,quote_count,wiki,reads,bookmark_count,post_type,post_number,last_editor_id,version,cooked,like_score,incoming_link_count,off_topic_count,last_version_at,user_deleted,action_code,edit_reason,self_edits,notify_user_count,reply_quoted,score,topic_id,reply_to_post_number,notify_moderators_count,deleted_at,reply_count,updated_at,public_version,locked_by_id,outbound_message_id,hidden,cook_method,sort_order) | |
topics(deleted_by_id,views,last_post_user_id,fancy_title,highest_post_number,pinned_at,closed,last_posted_at,featured_link,percent_rank,updated_at,has_summary,featured_user2_id,score,external_id,moderator_posts_count,bannered_until,deleted_at,reply_count,featured_ |
This file contains 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
#!/usr/bin/env ruby | |
require "curses" | |
require "fileutils" | |
require "open-uri" | |
require "shellwords" | |
plugin_dir = File.expand_path("~/Source/discourse/plugins") | |
disabled_plugin_dir = File.expand_path("~/Source/discourse-plugins") |
This file contains 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
#!/usr/bin/env ruby | |
require "curses" | |
require "fileutils" | |
plugin_dir = File.expand_path("~/Source/discourse/plugins") | |
disabled_plugin_dir = File.expand_path("~/Source/discourse-plugins") | |
Curses.init_screen | |
Curses.noecho |
This file contains 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
#!/usr/bin/env ruby | |
require "curses" | |
require "fileutils" | |
plugin_dir = File.expand_path("~/Source/discourse/plugins") | |
disabled_plugin_dir = File.expand_path("~/Source/discourse-plugins") | |
Curses.init_screen | |
Curses.noecho |
This file contains 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 "openai" | |
require "tempfile" | |
require "optparse" | |
API_KEY = ENV["OPEN_AI_API_KEY"] | |
intensity = 1 | |
OptionParser | |
.new do |opts| |
NewerOlder