diff --git a/RPST GUI/RPST/ApiHandler.vb b/RPST GUI/RPST/ApiHandler.vb deleted file mode 100644 index d2a56d4..0000000 --- a/RPST GUI/RPST/ApiHandler.vb +++ /dev/null @@ -1,55 +0,0 @@ -Imports System.IO -Imports System.Net.Http -Imports Newtonsoft.Json -Imports Newtonsoft.Json.Linq - -''' -''' Handles requests to Reddit and Github APIs. -''' -Public Class ApiHandler - Public Property LogFile As String = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "RedditPostScrapingTool", "logs", $"debug.log") - Public Property Headers As String = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15" - Public Property UpdatesEndpoint As String = "https://api.github.com/repos/bellingcat/reddit-post-scraping-tool/releases/latest" - - ''' - ''' Asyncrosnously scrape Reddit data. - ''' - ''' Json object containing scraped data. - Public Async Function ScrapeRedditAsync(subreddit As String, listing As String, limit As Integer, timeframe As String) As Task(Of JObject) - Dim ApiEndpoint As String = $"https://www.reddit.com/r/{subreddit}/{listing}.json?limit={limit}&t={timeframe}" - Return Await GetJObjectFromEndpointAsync(endpoint:=ApiEndpoint) - End Function - - ''' - ''' Asyncrosnously gets remote version information from the repository release page. - ''' - ''' Json object containing update data. - Public Async Function CheckUpdatesAsync() As Task(Of JObject) - Return Await GetJObjectFromEndpointAsync(endpoint:=UpdatesEndpoint) - End Function - - ''' - ''' Asyncronously retrieves a JObject from the specified endpoint. - ''' - ''' The URL endpoint to retrieve data from. - ''' A JObject containing the retrieved data. - Private Async Function GetJObjectFromEndpointAsync(endpoint As String) As Task(Of JObject) - Try - Using httpClient As New HttpClient() - httpClient.DefaultRequestHeaders.Add("User-Agent", Headers) - Dim response As HttpResponseMessage = Await httpClient.GetAsync(endpoint) - If response.IsSuccessStatusCode Then - Dim json As String = response.Content.ReadAsStringAsync().Result - Dim data As JObject = JsonConvert.DeserializeObject(Of JObject)(json) - Return data - Else - MessageBox.Show(response.ReasonPhrase, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) - End If - End Using - Catch ex As Exception - My.Computer.FileSystem.WriteAllText(LogFile, $"{DateTime.Now}: {ex}{Environment.NewLine}", True) - MessageBox.Show($"{ex.Message}. Please see the debug log '{LogFile}' for more information.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) - End Try - Return New JObject() - End Function -End Class diff --git a/RPST GUI/RPST/ApplicationEvents.vb b/RPST GUI/RPST/ApplicationEvents.vb deleted file mode 100644 index f9974e1..0000000 --- a/RPST GUI/RPST/ApplicationEvents.vb +++ /dev/null @@ -1,29 +0,0 @@ -Imports Microsoft.VisualBasic.ApplicationServices - -Namespace My - ' The following events are available for MyApplication: - ' Startup: Raised when the application starts, before the startup form is created. - ' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally. - ' UnhandledException: Raised if the application encounters an unhandled exception. - ' StartupNextInstance: Raised when launching a single-instance application and the application is already active. - ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected. - - ' **NEW** ApplyApplicationDefaults: Raised when the application queries default values to be set for the application. - - ' Example: - ' Private Sub MyApplication_ApplyApplicationDefaults(sender As Object, e As ApplyApplicationDefaultsEventArgs) Handles Me.ApplyApplicationDefaults - ' - ' ' Setting the application-wide default Font: - ' e.Font = New Font(FontFamily.GenericSansSerif, 12, FontStyle.Regular) - ' - ' ' Setting the HighDpiMode for the Application: - ' e.HighDpiMode = HighDpiMode.PerMonitorV2 - ' - ' ' If a splash dialog is used, this sets the minimum display time: - ' e.MinimumSplashScreenDisplayTime = 4000 - ' End Sub - - Partial Friend Class MyApplication - - End Class -End Namespace diff --git a/RPST GUI/RPST/LICENSE b/RPST GUI/RPST/LICENSE deleted file mode 100644 index edb9e84..0000000 --- a/RPST GUI/RPST/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Richard Mwewa - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/RPST GUI/RPST/My Project/Application.Designer.vb b/RPST GUI/RPST/My Project/Application.Designer.vb deleted file mode 100644 index 73f46c2..0000000 --- a/RPST GUI/RPST/My Project/Application.Designer.vb +++ /dev/null @@ -1,45 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Namespace My - - 'NOTE: This file is auto-generated; do not modify it directly. To make changes, - ' or if you encounter build errors in this file, go to the Project Designer - ' (go to Project Properties or double-click the My Project node in - ' Solution Explorer), and make changes on the Application tab. - ' - Partial Friend Class MyApplication - - _ - Public Sub New() - MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) - Me.IsSingleInstance = false - Me.EnableVisualStyles = true - Me.SaveMySettingsOnExit = true - Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses - Me.HighDpiMode = HighDpiMode.DpiUnaware - End Sub - - _ - Protected Overrides Sub OnCreateMainForm() - Me.MainForm = Global.RPST.MainWindow - End Sub - - - Protected Overrides Function OnInitialize(ByVal commandLineArgs As System.Collections.ObjectModel.ReadOnlyCollection(Of String)) As Boolean - Me.MinimumSplashScreenDisplayTime = 2000 - Return MyBase.OnInitialize(commandLineArgs) - End Function - End Class -End Namespace diff --git a/RPST GUI/RPST/My Project/Application.myapp b/RPST GUI/RPST/My Project/Application.myapp deleted file mode 100644 index 0f377ee..0000000 --- a/RPST GUI/RPST/My Project/Application.myapp +++ /dev/null @@ -1,12 +0,0 @@ - - - true - MainWindow - false - 0 - true - 0 - true - - 2000 - \ No newline at end of file diff --git a/RPST GUI/RPST/My Project/Resources.Designer.vb b/RPST GUI/RPST/My Project/Resources.Designer.vb deleted file mode 100644 index cc0c0d8..0000000 --- a/RPST GUI/RPST/My Project/Resources.Designer.vb +++ /dev/null @@ -1,63 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Imports System - -Namespace My.Resources - - 'This class was auto-generated by the StronglyTypedResourceBuilder - 'class via a tool like ResGen or Visual Studio. - 'To add or remove a member, edit your .ResX file then rerun ResGen - 'with the /str option, or rebuild your VS project. - ''' - ''' A strongly-typed resource class, for looking up localized strings, etc. - ''' - _ - Friend Module Resources - - Private resourceMan As Global.System.Resources.ResourceManager - - Private resourceCulture As Global.System.Globalization.CultureInfo - - ''' - ''' Returns the cached ResourceManager instance used by this class. - ''' - _ - Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager - Get - If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("RPST.Resources", GetType(Resources).Assembly) - resourceMan = temp - End If - Return resourceMan - End Get - End Property - - ''' - ''' Overrides the current thread's CurrentUICulture property for all - ''' resource lookups using this strongly typed resource class. - ''' - _ - Friend Property Culture() As Global.System.Globalization.CultureInfo - Get - Return resourceCulture - End Get - Set - resourceCulture = value - End Set - End Property - End Module -End Namespace diff --git a/RPST GUI/RPST/My Project/Resources.resx b/RPST GUI/RPST/My Project/Resources.resx deleted file mode 100644 index 29dcb1b..0000000 --- a/RPST GUI/RPST/My Project/Resources.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/RPST GUI/RPST/README.md b/RPST GUI/RPST/README.md deleted file mode 100644 index f301177..0000000 --- a/RPST GUI/RPST/README.md +++ /dev/null @@ -1,52 +0,0 @@ -![rpst](https://github.com/bellingcat/reddit-post-scraping-tool/assets/74001397/b9ec50b2-d2cb-419f-b8f0-d170b0630875) - -## Note - -> Use [Knew Karma](https://github.com/bellingcat/knewkarma) for more advanced and improved features. - -# RPST (Reddit Post Scraping Tool) - -Retrieve **Reddit** posts that contain the specified **keyword** from a specified **subreddit**. - -[![Upload Python Package](https://github.com/bellingcat/reddit-post-scraping-tool/actions/workflows/python-publish.yml/badge.svg)](https://github.com/rly0nheart/reddit-post-scraping-tool/actions/workflows/python-publish.yml) [![CodeQL](https://github.com/bellingcat/reddit-post-scraping-tool/actions/workflows/codeql.yml/badge.svg)](https://github.com/rly0nheart/reddit-post-scraping-tool/actions/workflows/codeql.yml) ![.Net](https://img.shields.io/badge/.NET-5C2D91?style=flat&logo=.net&logoColor=white) ![Python](https://img.shields.io/badge/python-3670A0?style=flat&logo=python&logoColor=ffdd54) - -# ✅ Features - -## *GUI* - -- [x] Dark mode (*Right-click>Settings>Dark Mode*). -- [x] Saves results to a JSON/CSV file (*Right-click>Settings>Save posts>to JSON/to CSV*). -- [x] Logs errors to a file. -- [x] In-App feature to check for Updates. - -## *CLI* - -- [x] Saves results to JSON (*specifiy* `--json`). -- [x] Saves results to CSV (*specify* `--csv`). -- [x] Automatically checks for new updates, and notifies user if updates were found. - -# 📃 TODO - -## *GUI* - -- [ ] Make it installable with a setup.exe/setup.msi file. - -# 🖥️ Tested environments - -## *GUI* - -- [x] Microsoft Windows 11 - -## *CLI* - -- [x] Android Termux -- [x] Microsoft Windows 11 -- [x] Ubuntu 22.04 - latest versions - -# 📖 Documentation - -[Refer to the Wiki](https://github.com/bellingcat/reddit-post-scraping-tool/wiki) for installation instructions, in -addition to all other documentation. - -*** -[![me](https://github.com/bellingcat/knewkarma/assets/74001397/efd19c7e-9840-4969-b33c-04087e73e4da)](https://about.me/rly0nheart) diff --git a/RPST GUI/RPST/RPST.vbproj b/RPST GUI/RPST/RPST.vbproj deleted file mode 100644 index 7bc0df6..0000000 --- a/RPST GUI/RPST/RPST.vbproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - WinExe - net6.0-windows - RPST.My.MyApplication - true - WindowsForms - Resources\icon.ico - Richard Mwewa - Retrieve Reddit posts that contain the specified keyword from a specified subreddit. - © 2023 Richard Mwewa. All rights reserved. - https://github.com/bellingcat/reddit-post-scraping-tool - README.md - https://github.com/bellingcat/reddit-post-scraping-tool - 2.0.0.0 - 2.0.0.0 - LICENSE - True - 2.0.0 - reddit;scraper;reddit-scraper;osint - - 6.0-recommended - RPST - Richard Mwewa - en - $(AssemblyName) (Reddit Post Scraping Tool) - RPST - Reddit Post Scraping Tool. - icon.png - - - - - - - - - - - - - - - - - - - True - True - Application.myapp - - - True - True - Resources.resx - - - - - - My.Resources - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - - - - - - True - \ - - - MyApplicationCodeGenerator - Application.Designer.vb - - - True - \ - - - True - \ - - - - diff --git a/RPST GUI/RPST/RPST.vbproj.user b/RPST GUI/RPST/RPST.vbproj.user deleted file mode 100644 index c1bdef1..0000000 --- a/RPST GUI/RPST/RPST.vbproj.user +++ /dev/null @@ -1,14 +0,0 @@ - - - - - Form - - - Form - - - Form - - - \ No newline at end of file