7 Commits

Author SHA1 Message Date
Richard Mwewa
1f3d8f41eb Merge pull request #5 from bellingcat/dev
Dev
2023-08-08 07:15:29 +02:00
Richard Mwewa
4ac58f0fc4 Update README.md 2023-08-08 07:10:13 +02:00
Richard Mwewa
7696dd923a Update __main.py
Changed layout and applied dark mode to the "Right Click" menu
2023-08-08 07:08:58 +02:00
Richard Mwewa
45b82e57ac Update pyproject.toml
Changed layout and applied dark mode to the "Right Click" Menu
2023-08-08 07:07:52 +02:00
Richard Mwewa
6d6e616640 Update README.md 2023-08-08 07:06:52 +02:00
Richard Mwewa
4ba402a129 Add files via upload
1.5.0.0
2023-08-08 07:00:32 +02:00
Richard Mwewa
52d36baae2 Delete RPST GUI directory 2023-08-07 16:29:00 +02:00
24 changed files with 1419 additions and 1231 deletions

View File

@@ -1,12 +1,9 @@
# RPST (Reddit Post Scraping Tool) # RPST (Reddit Post Scraping Tool)
Given a subreddit name and a keyword, this script will return all posts from a specified listing (default is 'top') that contain the provided keyword. Given a subreddit name and a keyword, RPST will return all posts from a specified listing (default is 'top') that contain the provided keyword.
[![Upload Python Package](https://github.com/rly0nheart/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/rly0nheart/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) [![Upload Python Package](https://github.com/rly0nheart/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/rly0nheart/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)
![2023-08-07_02-13_1](https://github.com/bellingcat/reddit-post-scraping-tool/assets/74001397/5ea98745-8b5f-4a93-9a53-befa491f7b6a) ![2023-08-08_07-04](https://github.com/bellingcat/reddit-post-scraping-tool/assets/74001397/10d91093-7b24-4de9-9f02-454b842d6b8e)
![2023-08-07_02-13](https://github.com/bellingcat/reddit-post-scraping-tool/assets/74001397/f303abc7-8a83-44b0-97c9-a447c459cef9) ![2023-08-08_07-04_1](https://github.com/bellingcat/reddit-post-scraping-tool/assets/74001397/268a4c0e-d849-49a3-94ba-296d193774e1)
# ✅ Features # ✅ Features

View File

@@ -59,32 +59,32 @@ Partial Class AboutBox
' LabelProgramDescription ' LabelProgramDescription
' '
LabelProgramDescription.AutoSize = True LabelProgramDescription.AutoSize = True
LabelProgramDescription.Font = New Font("Comic Sans MS", 9F, FontStyle.Regular, GraphicsUnit.Point) LabelProgramDescription.Font = New Font("Segoe UI Semibold", 9F, FontStyle.Bold, GraphicsUnit.Point)
LabelProgramDescription.ForeColor = SystemColors.ControlText LabelProgramDescription.ForeColor = SystemColors.ControlText
LabelProgramDescription.Location = New Point(4, 54) LabelProgramDescription.Location = New Point(4, 54)
LabelProgramDescription.Name = "LabelProgramDescription" LabelProgramDescription.Name = "LabelProgramDescription"
LabelProgramDescription.Size = New Size(73, 17) LabelProgramDescription.Size = New Size(68, 15)
LabelProgramDescription.TabIndex = 4 LabelProgramDescription.TabIndex = 4
LabelProgramDescription.Text = "Description" LabelProgramDescription.Text = "Description"
' '
' LabelVersion ' LabelVersion
' '
LabelVersion.AutoSize = True LabelVersion.AutoSize = True
LabelVersion.Font = New Font("Comic Sans MS", 9F, FontStyle.Underline, GraphicsUnit.Point) LabelVersion.Font = New Font("Segoe UI", 9F, FontStyle.Underline, GraphicsUnit.Point)
LabelVersion.ForeColor = SystemColors.ControlText LabelVersion.ForeColor = SystemColors.ControlText
LabelVersion.Location = New Point(372, 17) LabelVersion.Location = New Point(372, 17)
LabelVersion.Name = "LabelVersion" LabelVersion.Name = "LabelVersion"
LabelVersion.Size = New Size(50, 17) LabelVersion.Size = New Size(45, 15)
LabelVersion.TabIndex = 5 LabelVersion.TabIndex = 5
LabelVersion.Text = "Version" LabelVersion.Text = "Version"
' '
' LinkLabelReadtheWiki ' LinkLabelReadtheWiki
' '
LinkLabelReadtheWiki.AutoSize = True LinkLabelReadtheWiki.AutoSize = True
LinkLabelReadtheWiki.Font = New Font("Comic Sans MS", 9F, FontStyle.Regular, GraphicsUnit.Point) LinkLabelReadtheWiki.Font = New Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point)
LinkLabelReadtheWiki.Location = New Point(337, 54) LinkLabelReadtheWiki.Location = New Point(337, 54)
LinkLabelReadtheWiki.Name = "LinkLabelReadtheWiki" LinkLabelReadtheWiki.Name = "LinkLabelReadtheWiki"
LinkLabelReadtheWiki.Size = New Size(85, 17) LinkLabelReadtheWiki.Size = New Size(79, 15)
LinkLabelReadtheWiki.TabIndex = 6 LinkLabelReadtheWiki.TabIndex = 6
LinkLabelReadtheWiki.TabStop = True LinkLabelReadtheWiki.TabStop = True
LinkLabelReadtheWiki.Text = "Read the Wiki" LinkLabelReadtheWiki.Text = "Read the Wiki"

View File

@@ -21,8 +21,8 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
SOFTWARE."
''' <summary> ''' <summary>
''' Handles the Load event for the AboutBox form. ''' Handles the Load event for the AboutBox form.
@@ -33,7 +33,7 @@ SOFTWARE."
settings.LoadSettings() settings.LoadSettings()
settings.ToggleDarkMode(settings.DarkMode) settings.ToggleDarkMode(settings.DarkMode)
LabelProgramName.Text = My.Application.Info.AssemblyName LabelProgramName.Text = My.Application.Info.ProductName
LabelProgramDescription.Text = "Given a subreddit name and a keyword, LabelProgramDescription.Text = "Given a subreddit name and a keyword,
RPST returns all top posts RPST returns all top posts
(by default) that contain the specified keyword." (by default) that contain the specified keyword."

View File

@@ -7,31 +7,31 @@ Public Class DataGridViewHandler
''' <param name="dataGridView">The DataGridView to be initialized.</param> ''' <param name="dataGridView">The DataGridView to be initialized.</param>
Public Shared Sub AddColumn(dataGridView As DataGridView) Public Shared Sub AddColumn(dataGridView As DataGridView)
' Clear the Columns and Rows before adding Items to them ' Clear the Columns and Rows before adding Items to them
PostsForm.DataGridViewPosts.Rows.Clear() dataGridView.Rows.Clear()
PostsForm.DataGridViewPosts.Columns.Clear() dataGridView.Columns.Clear()
PostsForm.DataGridViewPosts.Columns.Add("PostCount", "Post Number") dataGridView.Columns.Add("PostCount", "Index")
PostsForm.DataGridViewPosts.Columns.Add("PostAuthor", "Author") dataGridView.Columns.Add("PostAuthor", "Author")
PostsForm.DataGridViewPosts.Columns.Add("PostID", "ID") dataGridView.Columns.Add("PostID", "Post ID")
PostsForm.DataGridViewPosts.Columns.Add("PostSubreddit", "Subreddit") dataGridView.Columns.Add("PostText", "Post Text")
PostsForm.DataGridViewPosts.Columns.Add("SubredditVisibility", "Subreddit Visibility") dataGridView.Columns.Add("PostSubreddit", "Subreddit")
PostsForm.DataGridViewPosts.Columns.Add("PostThumbnail", "Thumbnail") dataGridView.Columns.Add("SubredditVisibility", "Subreddit Visibility")
PostsForm.DataGridViewPosts.Columns.Add("PostIsNSFW", "NSFW") dataGridView.Columns.Add("PostThumbnail", "Thumbnail")
PostsForm.DataGridViewPosts.Columns.Add("PostIsGilded", "Gilded") dataGridView.Columns.Add("PostIsNSFW", "NSFW")
PostsForm.DataGridViewPosts.Columns.Add("PostUpvotes", "Upvotes") dataGridView.Columns.Add("PostIsGilded", "Gilded")
PostsForm.DataGridViewPosts.Columns.Add("PostUpvoteRatio", "Upvote Ratio") dataGridView.Columns.Add("PostUpvotes", "Upvotes")
PostsForm.DataGridViewPosts.Columns.Add("PostDownvotes", "Downvotes") dataGridView.Columns.Add("PostUpvoteRatio", "Upvote Ratio")
PostsForm.DataGridViewPosts.Columns.Add("PostAwards", "Awards") dataGridView.Columns.Add("PostDownvotes", "Downvotes")
PostsForm.DataGridViewPosts.Columns.Add("PostTopAward", "Top Award") dataGridView.Columns.Add("PostAwards", "Awards")
PostsForm.DataGridViewPosts.Columns.Add("PostIsCrosspostable", "Is Crosspostable?") dataGridView.Columns.Add("PostTopAward", "Top Award")
PostsForm.DataGridViewPosts.Columns.Add("PostScore", "Score") dataGridView.Columns.Add("PostIsCrosspostable", "Is Crosspostable?")
PostsForm.DataGridViewPosts.Columns.Add("PostText", "Text") dataGridView.Columns.Add("PostScore", "Score")
PostsForm.DataGridViewPosts.Columns.Add("PostCategory", "Category") dataGridView.Columns.Add("PostCategory", "Category")
PostsForm.DataGridViewPosts.Columns.Add("PostDomain", "Domain") dataGridView.Columns.Add("PostDomain", "Domain")
PostsForm.DataGridViewPosts.Columns.Add("PostPermalink", "Permalink") dataGridView.Columns.Add("PostPermalink", "Permalink")
PostsForm.DataGridViewPosts.Columns.Add("PostCreatedAt", "Created At") dataGridView.Columns.Add("PostCreatedAt", "Created At")
PostsForm.DataGridViewPosts.Columns.Add("PostApprovedAt", "Approved At") dataGridView.Columns.Add("PostApprovedAt", "Approved At")
PostsForm.DataGridViewPosts.Columns.Add("PostApprovedBy", "Approved By") dataGridView.Columns.Add("PostApprovedBy", "Approved By")
End Sub End Sub
Public Shared Sub AddRow(dataGridView As DataGridView, post As JObject, postNumber As Integer) Public Shared Sub AddRow(dataGridView As DataGridView, post As JObject, postNumber As Integer)
@@ -41,9 +41,10 @@ Public Class DataGridViewHandler
''' <param name="dataGridView">The DataGridView to which the row will be added.</param> ''' <param name="dataGridView">The DataGridView to which the row will be added.</param>
''' <param name="post">A JObject representing the Reddit post.</param> ''' <param name="post">A JObject representing the Reddit post.</param>
''' <param name="postNumber">The number of the post.</param> ''' <param name="postNumber">The number of the post.</param>
PostsForm.DataGridViewPosts.Rows.Add(postNumber, dataGridView.Rows.Add(postNumber,
post("data")("author"), post("data")("author"),
post("data")("id"), post("data")("id"),
post("data")("selftext"),
post("data")("subreddit_name_prefixed"), post("data")("subreddit_name_prefixed"),
post("data")("subreddit_type"), post("data")("subreddit_type"),
post("data")("thumbnail"), post("data")("thumbnail"),
@@ -56,7 +57,6 @@ Public Class DataGridViewHandler
post("data")("top_awarded_type"), post("data")("top_awarded_type"),
post("data")("is_crosspostable"), post("data")("is_crosspostable"),
post("data")("score"), post("data")("score"),
post("data")("selftext"),
post("data")("category"), post("data")("category"),
post("data")("domain"), post("data")("domain"),
post("data")("permalink"), post("data")("permalink"),

View File

@@ -1,5 +1,5 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class DeveloperForm Partial Class DeveloperBox
Inherits System.Windows.Forms.Form Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list. 'Form overrides dispose to clean up the component list.
@@ -22,7 +22,7 @@ Partial Class DeveloperForm
'Do not modify it using the code editor. 'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> <System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent() Private Sub InitializeComponent()
Dim resources As ComponentModel.ComponentResourceManager = New ComponentModel.ComponentResourceManager(GetType(DeveloperForm)) Dim resources As ComponentModel.ComponentResourceManager = New ComponentModel.ComponentResourceManager(GetType(DeveloperBox))
AboutMeLinkLabel = New LinkLabel() AboutMeLinkLabel = New LinkLabel()
LinkLabelBuyMeACoffee = New LinkLabel() LinkLabelBuyMeACoffee = New LinkLabel()
GreetingLabel = New Label() GreetingLabel = New Label()

View File

@@ -1,4 +1,4 @@
Public Class DeveloperForm Public Class DeveloperBox
Private Sub DeveloperForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub DeveloperForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
GreetingLabel.BackColor = Color.Transparent GreetingLabel.BackColor = Color.Transparent
AboutMeLinkLabel.BackColor = Color.Transparent AboutMeLinkLabel.BackColor = Color.Transparent

View File

@@ -1,57 +0,0 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class PostsForm
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
DataGridViewPosts = New DataGridView()
CType(DataGridViewPosts, ComponentModel.ISupportInitialize).BeginInit()
SuspendLayout()
'
' DataGridViewPosts
'
DataGridViewPosts.BackgroundColor = Color.Gainsboro
DataGridViewPosts.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize
DataGridViewPosts.Dock = DockStyle.Fill
DataGridViewPosts.Location = New Point(0, 0)
DataGridViewPosts.Name = "DataGridViewPosts"
DataGridViewPosts.ReadOnly = True
DataGridViewPosts.RowHeadersVisible = False
DataGridViewPosts.RowTemplate.Height = 25
DataGridViewPosts.Size = New Size(800, 450)
DataGridViewPosts.TabIndex = 3
'
' PostsForm
'
AutoScaleDimensions = New SizeF(7F, 15F)
AutoScaleMode = AutoScaleMode.Font
ClientSize = New Size(800, 450)
Controls.Add(DataGridViewPosts)
Name = "PostsForm"
ShowIcon = False
ShowInTaskbar = False
Text = "PostsForm"
CType(DataGridViewPosts, ComponentModel.ISupportInitialize).EndInit()
ResumeLayout(False)
End Sub
Friend WithEvents DataGridViewPosts As DataGridView
End Class

View File

@@ -1,60 +0,0 @@
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -1,3 +0,0 @@
Public Class PostsForm
End Class

View File

@@ -1,7 +1,7 @@
Imports Newtonsoft.Json.Linq Imports Newtonsoft.Json.Linq
Public Class PostsProcessor Public Class PostsProcessor
Private ApiHandler As New ApiHandler Private ReadOnly ApiHandler As New ApiHandler
''' <summary> ''' <summary>
''' Fetches Reddit posts based on the given parameters and returns them as a JObject. ''' Fetches Reddit posts based on the given parameters and returns them as a JObject.
@@ -23,7 +23,7 @@ Public Class PostsProcessor
''' <param name="keyword">The keyword to check for.</param> ''' <param name="keyword">The keyword to check for.</param>
''' <returns>True if the post contains the keyword, False otherwise.</returns> ''' <returns>True if the post contains the keyword, False otherwise.</returns>
Public Shared Function PostContainsKeyword(post As JObject, keyword As String) As Boolean Public Shared Function PostContainsKeyword(post As JObject, keyword As String) As Boolean
Return post("data")("selftext").ToString.ToLower(System.Globalization.CultureInfo.InvariantCulture).Contains(keyword.ToLower(System.Globalization.CultureInfo.InvariantCulture)) Return post("data")("selftext").ToString.ToLower(Globalization.CultureInfo.InvariantCulture).Contains(keyword.ToLower(System.Globalization.CultureInfo.InvariantCulture))
End Function End Function
End Class End Class

View File

@@ -1,12 +1,9 @@
# RPST (Reddit Post Scraping Tool) # RPST (Reddit Post Scraping Tool)
Given a subreddit name and a keyword, this script will return all posts from a specified listing (default is 'top') that contain the provided keyword. Given a subreddit name and a keyword, RPST will return all posts from a specified listing (default is 'top') that contain the provided keyword.
[![Upload Python Package](https://github.com/rly0nheart/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/rly0nheart/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) [![Upload Python Package](https://github.com/rly0nheart/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/rly0nheart/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)
![2023-08-07_02-13_1](https://github.com/bellingcat/reddit-post-scraping-tool/assets/74001397/5ea98745-8b5f-4a93-9a53-befa491f7b6a) ![2023-08-08_07-04](https://github.com/bellingcat/reddit-post-scraping-tool/assets/74001397/10d91093-7b24-4de9-9f02-454b842d6b8e)
![2023-08-07_02-13](https://github.com/bellingcat/reddit-post-scraping-tool/assets/74001397/f303abc7-8a83-44b0-97c9-a447c459cef9) ![2023-08-08_07-04_1](https://github.com/bellingcat/reddit-post-scraping-tool/assets/74001397/268a4c0e-d849-49a3-94ba-296d193774e1)
# ✅ Features # ✅ Features

View File

@@ -13,19 +13,19 @@
<PackageProjectUrl>https://github.com/bellingcat/reddit-post-scraping-tool</PackageProjectUrl> <PackageProjectUrl>https://github.com/bellingcat/reddit-post-scraping-tool</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile> <PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/bellingcat/reddit-post-scraping-tool</RepositoryUrl> <RepositoryUrl>https://github.com/bellingcat/reddit-post-scraping-tool</RepositoryUrl>
<AssemblyVersion>1.4.1.0</AssemblyVersion> <AssemblyVersion>1.5.0.0</AssemblyVersion>
<FileVersion>1.4.1.0</FileVersion> <FileVersion>1.5.0.0</FileVersion>
<PackageLicenseFile>LICENSE</PackageLicenseFile> <PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance> <PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<Version>1.4.1</Version> <Version>1.5.0</Version>
<PackageTags>reddit;scraper;reddit-scraper;osint</PackageTags> <PackageTags>reddit;scraper;reddit-scraper;osint</PackageTags>
<PackageReleaseNotes></PackageReleaseNotes> <PackageReleaseNotes></PackageReleaseNotes>
<AnalysisLevel>6.0-recommended</AnalysisLevel> <AnalysisLevel>6.0-recommended</AnalysisLevel>
<PackageId>RPST (Reddit Post Scraping Tool)</PackageId> <PackageId>RPST</PackageId>
<Authors>Richard Mwewa</Authors> <Authors>Richard Mwewa</Authors>
<NeutralLanguage>en</NeutralLanguage> <NeutralLanguage>en</NeutralLanguage>
<Product>$(AssemblyName)</Product> <Product>$(AssemblyName) (Reddit Post Scraping Tool)</Product>
<AssemblyName>RPST (Reddit Post Scraping Tool)</AssemblyName> <AssemblyName>RPST</AssemblyName>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@@ -4,10 +4,7 @@
<Compile Update="AboutBox.vb"> <Compile Update="AboutBox.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Update="DeveloperForm.vb"> <Compile Update="DeveloperBox.vb">
<SubType>Form</SubType>
</Compile>
<Compile Update="PostsForm.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Update="StartForm.vb"> <Compile Update="StartForm.vb">

57
RPST GUI/RPST/ResultsForm.Designer.vb generated Normal file
View File

@@ -0,0 +1,57 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class ResultsForm
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
DataGridViewResults = New DataGridView()
CType(DataGridViewResults, ComponentModel.ISupportInitialize).BeginInit()
SuspendLayout()
'
' DataGridViewResults
'
DataGridViewResults.BackgroundColor = Color.Gainsboro
DataGridViewResults.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize
DataGridViewResults.Dock = DockStyle.Fill
DataGridViewResults.Location = New Point(0, 0)
DataGridViewResults.Name = "DataGridViewResults"
DataGridViewResults.ReadOnly = True
DataGridViewResults.RowHeadersVisible = False
DataGridViewResults.RowTemplate.Height = 25
DataGridViewResults.Size = New Size(800, 450)
DataGridViewResults.TabIndex = 3
'
' ResultsForm
'
AutoScaleDimensions = New SizeF(7.0F, 15.0F)
AutoScaleMode = AutoScaleMode.Font
ClientSize = New Size(800, 450)
Controls.Add(DataGridViewResults)
Name = "ResultsForm"
ShowIcon = False
ShowInTaskbar = False
Text = "ResultsForm"
CType(DataGridViewResults, ComponentModel.ISupportInitialize).EndInit()
ResumeLayout(False)
End Sub
Friend WithEvents DataGridViewResults As DataGridView
End Class

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1 @@


View File

@@ -25,7 +25,7 @@ Public Class SettingsManager
Dim options As New JsonSerializerOptions With {.PropertyNameCaseInsensitive = True} Dim options As New JsonSerializerOptions With {.PropertyNameCaseInsensitive = True}
Dim settings = Text.Json.JsonSerializer.Deserialize(Of SettingsManager)(json, options) Dim settings = Text.Json.JsonSerializer.Deserialize(Of SettingsManager)(json, options)
Me.DarkMode = settings.DarkMode Me.DarkMode = settings.DarkMode
StartForm.DarkModeToolStripMenuItem.Checked = settings.DarkMode StartForm.ToolStripMenuItemDarkMode.Checked = settings.DarkMode
Else Else
' Settings file does not exist ' Settings file does not exist
' Create a new file with default settings 'False' ' Create a new file with default settings 'False'
@@ -34,7 +34,7 @@ Public Class SettingsManager
File.WriteAllText(settingsFilePath, jsonOutput) File.WriteAllText(settingsFilePath, jsonOutput)
Me.DarkMode = False Me.DarkMode = False
StartForm.DarkModeToolStripMenuItem.Checked = False StartForm.ToolStripMenuItemDarkMode.Checked = False
End If End If
End Sub End Sub
@@ -46,7 +46,7 @@ Public Class SettingsManager
Public Sub ToggleDarkMode(enabled As Boolean) Public Sub ToggleDarkMode(enabled As Boolean)
Dim json As String = File.ReadAllText(settingsFilePath) Dim json As String = File.ReadAllText(settingsFilePath)
Dim options As New JsonSerializerOptions With {.PropertyNameCaseInsensitive = True} Dim options As New JsonSerializerOptions With {.PropertyNameCaseInsensitive = True}
Dim settings As SettingsManager = Text.Json.JsonSerializer.Deserialize(Of SettingsManager)(json, options) Dim settings As SettingsManager = JsonSerializer.Deserialize(Of SettingsManager)(json, options)
settings.DarkMode = enabled settings.DarkMode = enabled
SaveSettings(settings) SaveSettings(settings)
ApplyTheme() ApplyTheme()
@@ -57,7 +57,7 @@ Public Class SettingsManager
''' </summary> ''' </summary>
''' <param name="settings">An instance of the SettingsManager containing the configurations to be saved.</param> ''' <param name="settings">An instance of the SettingsManager containing the configurations to be saved.</param>
Private Sub SaveSettings(settings) Private Sub SaveSettings(settings)
Dim jsonOutput = Text.Json.JsonSerializer.Serialize(settings) Dim jsonOutput = JsonSerializer.Serialize(settings)
File.WriteAllText(settingsFilePath, jsonOutput) File.WriteAllText(settingsFilePath, jsonOutput)
End Sub End Sub
@@ -70,69 +70,128 @@ Public Class SettingsManager
Dim DarkMode As Boolean = GetDarkMode() Dim DarkMode As Boolean = GetDarkMode()
If DarkMode Then If DarkMode Then
' Enable dark mode for the Main form ' Enable dark mode for the Main form
' Background colours (I know 'Colours'/'Colors'😆)
StartForm.BackColor = ColorTranslator.FromHtml("#FF121212") StartForm.BackColor = ColorTranslator.FromHtml("#FF121212")
StartForm.ToolsToolStripMenuTools.ForeColor = ColorTranslator.FromHtml("#FFFFFFFF")
StartForm.KeywordTextBox.BackColor = ColorTranslator.FromHtml("#FF2E2E2E")
StartForm.KeywordTextBox.ForeColor = SystemColors.Control
StartForm.SubredditTextBox.BackColor = ColorTranslator.FromHtml("#FF2E2E2E") StartForm.SubredditTextBox.BackColor = ColorTranslator.FromHtml("#FF2E2E2E")
StartForm.SubredditTextBox.ForeColor = SystemColors.Control StartForm.KeywordTextBox.BackColor = ColorTranslator.FromHtml("#FF2E2E2E")
StartForm.LimitNumericUpDown.BackColor = ColorTranslator.FromHtml("#FF2E2E2E") StartForm.LimitNumericUpDown.BackColor = ColorTranslator.FromHtml("#FF2E2E2E")
StartForm.LimitNumericUpDown.ForeColor = SystemColors.Control
StartForm.LimitNumericUpDown.BackColor = ColorTranslator.FromHtml("#FF2E2E2E") StartForm.LimitNumericUpDown.BackColor = ColorTranslator.FromHtml("#FF2E2E2E")
StartForm.LimitNumericUpDown.ForeColor = SystemColors.Control
StartForm.ListingComboBox.BackColor = ColorTranslator.FromHtml("#FF2E2E2E") StartForm.ListingComboBox.BackColor = ColorTranslator.FromHtml("#FF2E2E2E")
StartForm.ListingComboBox.ForeColor = SystemColors.Control
StartForm.TimeframeComboBox.BackColor = ColorTranslator.FromHtml("#FF2E2E2E") StartForm.TimeframeComboBox.BackColor = ColorTranslator.FromHtml("#FF2E2E2E")
' Foreground colours
StartForm.KeywordTextBox.ForeColor = SystemColors.Control
StartForm.SubredditTextBox.ForeColor = SystemColors.Control
StartForm.LimitNumericUpDown.ForeColor = SystemColors.Control
StartForm.LimitNumericUpDown.ForeColor = SystemColors.Control
StartForm.ListingComboBox.ForeColor = SystemColors.Control
StartForm.TimeframeComboBox.ForeColor = SystemColors.Control StartForm.TimeframeComboBox.ForeColor = SystemColors.Control
StartForm.LabelRPST.ForeColor = SystemColors.Control
StartForm.LabelKeyword.ForeColor = SystemColors.Control StartForm.LabelKeyword.ForeColor = SystemColors.Control
StartForm.LabelSubreddit.ForeColor = SystemColors.Control StartForm.LabelSubreddit.ForeColor = SystemColors.Control
StartForm.LabelLimit.ForeColor = SystemColors.Control StartForm.LabelLimit.ForeColor = SystemColors.Control
StartForm.LabelListing.ForeColor = SystemColors.Control StartForm.LabelListing.ForeColor = SystemColors.Control
StartForm.LabelTimeframe.ForeColor = SystemColors.Control StartForm.LabelTimeframe.ForeColor = SystemColors.Control
ResultsForm.BackColor = ColorTranslator.FromHtml("#FF121212")
' Enable dark mode on 'Right Click Menu' items
' Background colours
StartForm.ToolStripMenuItemDarkMode.BackColor = ColorTranslator.FromHtml("#FF121212")
StartForm.ToolStripMenuItemSavePosts.BackColor = ColorTranslator.FromHtml("#FF121212")
StartForm.ToolStripMenuItemtoJSON.BackColor = ColorTranslator.FromHtml("#FF121212")
StartForm.ToolStripMenuItemtoCSV.BackColor = ColorTranslator.FromHtml("#FF121212")
StartForm.ToolStripMenuItemAbout.BackColor = ColorTranslator.FromHtml("#FF121212")
StartForm.ToolStripMenuItemDeveloper.BackColor = ColorTranslator.FromHtml("#FF121212")
StartForm.ToolStripMenuItemCheckUpdates.BackColor = ColorTranslator.FromHtml("#FF121212")
StartForm.ToolStripMenuItemQuit.BackColor = ColorTranslator.FromHtml("#FF121212")
' Foreground colours
StartForm.ToolStripMenuItemDarkMode.ForeColor = SystemColors.Control
StartForm.ToolStripMenuItemSavePosts.ForeColor = SystemColors.Control
StartForm.ToolStripMenuItemtoJSON.ForeColor = SystemColors.Control
StartForm.ToolStripMenuItemtoCSV.ForeColor = SystemColors.Control
StartForm.ToolStripMenuItemAbout.ForeColor = SystemColors.Control
StartForm.ToolStripMenuItemDeveloper.ForeColor = SystemColors.Control
StartForm.ToolStripMenuItemCheckUpdates.ForeColor = SystemColors.Control
StartForm.ToolStripMenuItemQuit.ForeColor = SystemColors.Control
' Enable dark mode for the About box ' Enable dark mode for the About box
' Background colours
AboutBox.BackColor = ColorTranslator.FromHtml("#FF121212") AboutBox.BackColor = ColorTranslator.FromHtml("#FF121212")
AboutBox.ForeColor = SystemColors.Control
AboutBox.LicenseRichTextBox.BackColor = ColorTranslator.FromHtml("#FF2E2E2E") AboutBox.LicenseRichTextBox.BackColor = ColorTranslator.FromHtml("#FF2E2E2E")
AboutBox.LicenseRichTextBox.ForeColor = SystemColors.Control
AboutBox.Panel1.BackColor = ColorTranslator.FromHtml("#FF121212") AboutBox.Panel1.BackColor = ColorTranslator.FromHtml("#FF121212")
' Foreground colours
AboutBox.ForeColor = SystemColors.Control
AboutBox.LicenseRichTextBox.ForeColor = SystemColors.Control
AboutBox.LabelProgramName.ForeColor = SystemColors.Control AboutBox.LabelProgramName.ForeColor = SystemColors.Control
AboutBox.LabelProgramDescription.ForeColor = SystemColors.Control AboutBox.LabelProgramDescription.ForeColor = SystemColors.Control
AboutBox.LabelVersion.ForeColor = SystemColors.Control AboutBox.LabelVersion.ForeColor = SystemColors.Control
' If dark mode is enabled, set the 'Dark Mode' text value to 'Light mode'
StartForm.ToolStripMenuItemDarkMode.Text = "Light Mode"
Else Else
StartForm.BackColor = SystemColors.Control ' Disable dark mode for the Main Form
StartForm.ToolsToolStripMenuTools.ForeColor = ColorTranslator.FromHtml("#FF121212") ' Background colours
StartForm.BackColor = Color.Gainsboro
StartForm.KeywordTextBox.BackColor = SystemColors.Control StartForm.KeywordTextBox.BackColor = SystemColors.Control
StartForm.KeywordTextBox.ForeColor = ColorTranslator.FromHtml("#FF121212")
StartForm.SubredditTextBox.BackColor = SystemColors.Control StartForm.SubredditTextBox.BackColor = SystemColors.Control
StartForm.SubredditTextBox.ForeColor = ColorTranslator.FromHtml("#FF121212")
StartForm.LimitNumericUpDown.BackColor = SystemColors.Control StartForm.LimitNumericUpDown.BackColor = SystemColors.Control
StartForm.LimitNumericUpDown.ForeColor = ColorTranslator.FromHtml("#FF121212")
StartForm.LimitNumericUpDown.BackColor = SystemColors.Control StartForm.LimitNumericUpDown.BackColor = SystemColors.Control
StartForm.LimitNumericUpDown.ForeColor = ColorTranslator.FromHtml("#FF121212")
StartForm.ListingComboBox.BackColor = SystemColors.Control
StartForm.ListingComboBox.ForeColor = ColorTranslator.FromHtml("#FF121212")
StartForm.TimeframeComboBox.BackColor = SystemColors.Control StartForm.TimeframeComboBox.BackColor = SystemColors.Control
StartForm.ListingComboBox.BackColor = SystemColors.Control
' Foreground colours
StartForm.KeywordTextBox.ForeColor = ColorTranslator.FromHtml("#FF121212")
StartForm.SubredditTextBox.ForeColor = ColorTranslator.FromHtml("#FF121212")
StartForm.LimitNumericUpDown.ForeColor = ColorTranslator.FromHtml("#FF121212")
StartForm.LimitNumericUpDown.ForeColor = ColorTranslator.FromHtml("#FF121212")
StartForm.ListingComboBox.ForeColor = ColorTranslator.FromHtml("#FF121212")
StartForm.TimeframeComboBox.ForeColor = ColorTranslator.FromHtml("#FF121212") StartForm.TimeframeComboBox.ForeColor = ColorTranslator.FromHtml("#FF121212")
StartForm.LabelRPST.ForeColor = ColorTranslator.FromHtml("#FF121212")
StartForm.LabelKeyword.ForeColor = ColorTranslator.FromHtml("#FF121212") StartForm.LabelKeyword.ForeColor = ColorTranslator.FromHtml("#FF121212")
StartForm.LabelSubreddit.ForeColor = ColorTranslator.FromHtml("#FF121212") StartForm.LabelSubreddit.ForeColor = ColorTranslator.FromHtml("#FF121212")
StartForm.LabelLimit.ForeColor = ColorTranslator.FromHtml("#FF121212") StartForm.LabelLimit.ForeColor = ColorTranslator.FromHtml("#FF121212")
StartForm.LabelListing.ForeColor = ColorTranslator.FromHtml("#FF121212") StartForm.LabelListing.ForeColor = ColorTranslator.FromHtml("#FF121212")
StartForm.LabelTimeframe.ForeColor = ColorTranslator.FromHtml("#FF121212") StartForm.LabelTimeframe.ForeColor = ColorTranslator.FromHtml("#FF121212")
' Disable dark mode on 'Right Click Menu' items
' Background colours
StartForm.ToolStripMenuItemDarkMode.BackColor = Color.Gainsboro
StartForm.ToolStripMenuItemSavePosts.BackColor = Color.Gainsboro
StartForm.ToolStripMenuItemtoJSON.BackColor = Color.Gainsboro
StartForm.ToolStripMenuItemtoCSV.BackColor = Color.Gainsboro
StartForm.ToolStripMenuItemAbout.BackColor = Color.Gainsboro
StartForm.ToolStripMenuItemDeveloper.BackColor = Color.Gainsboro
StartForm.ToolStripMenuItemCheckUpdates.BackColor = Color.Gainsboro
StartForm.ToolStripMenuItemQuit.BackColor = Color.Gainsboro
' Foreground colours
StartForm.ToolStripMenuItemDarkMode.ForeColor = Color.Black
StartForm.ToolStripMenuItemSavePosts.ForeColor = Color.Black
StartForm.ToolStripMenuItemtoJSON.ForeColor = Color.Black
StartForm.ToolStripMenuItemtoCSV.ForeColor = Color.Black
StartForm.ToolStripMenuItemAbout.ForeColor = Color.Black
StartForm.ToolStripMenuItemDeveloper.ForeColor = Color.Black
StartForm.ToolStripMenuItemCheckUpdates.ForeColor = Color.Black
StartForm.ToolStripMenuItemQuit.ForeColor = Color.Black
' Disable dark mode for the About box ' Disable dark mode for the About box
' Background colours
AboutBox.BackColor = Color.Gainsboro AboutBox.BackColor = Color.Gainsboro
AboutBox.ForeColor = SystemColors.WindowText AboutBox.ForeColor = SystemColors.WindowText
AboutBox.LicenseRichTextBox.BackColor = SystemColors.Control AboutBox.LicenseRichTextBox.BackColor = SystemColors.Control
AboutBox.LicenseRichTextBox.ForeColor = SystemColors.WindowText AboutBox.LicenseRichTextBox.ForeColor = SystemColors.WindowText
AboutBox.Panel1.BackColor = Color.Gainsboro AboutBox.Panel1.BackColor = Color.Gainsboro
' Foreground colours
AboutBox.Panel1.ForeColor = SystemColors.WindowText AboutBox.Panel1.ForeColor = SystemColors.WindowText
AboutBox.LabelProgramName.ForeColor = SystemColors.WindowText AboutBox.LabelProgramName.ForeColor = SystemColors.WindowText
AboutBox.LabelProgramDescription.ForeColor = SystemColors.WindowText AboutBox.LabelProgramDescription.ForeColor = SystemColors.WindowText
AboutBox.LabelVersion.ForeColor = SystemColors.WindowText AboutBox.LabelVersion.ForeColor = SystemColors.WindowText
' If dark mode is disabled, set the 'Light Mode' text value to 'Dark Mode'
StartForm.ToolStripMenuItemDarkMode.Text = "Dark Mode"
End If End If
End Sub End Sub
''' <summary> ''' <summary>
''' Retrieves the Dark Mode setting value from 'settings.json'. ''' Retrieves the Dark Mode setting value from 'settings.json'.
''' If the settings file doesn't exist, defaults to returning 'False' (Dark Mode off). ''' If the settings file doesn't exist, defaults to returning 'False' (Dark Mode off).

View File

@@ -26,7 +26,7 @@ Partial Class StartForm
Dim resources As ComponentModel.ComponentResourceManager = New ComponentModel.ComponentResourceManager(GetType(StartForm)) Dim resources As ComponentModel.ComponentResourceManager = New ComponentModel.ComponentResourceManager(GetType(StartForm))
KeywordTextBox = New TextBox() KeywordTextBox = New TextBox()
SubredditTextBox = New TextBox() SubredditTextBox = New TextBox()
ScrapeButton = New Button() ButtonScrape = New Button()
TimeframeComboBox = New ComboBox() TimeframeComboBox = New ComboBox()
ListingComboBox = New ComboBox() ListingComboBox = New ComboBox()
LabelKeyword = New Label() LabelKeyword = New Label()
@@ -34,30 +34,28 @@ Partial Class StartForm
LabelLimit = New Label() LabelLimit = New Label()
LabelListing = New Label() LabelListing = New Label()
LabelTimeframe = New Label() LabelTimeframe = New Label()
ContextMenuStrip1 = New ContextMenuStrip(components) ContextMenuStripRightClick = New ContextMenuStrip(components)
SaveResultsStripMenuItem = New ToolStripMenuItem() ToolStripMenuItemDarkMode = New ToolStripMenuItem()
JSONToolStripMenuItem = New ToolStripMenuItem() ToolStripMenuItemSavePosts = New ToolStripMenuItem()
CSVToolStripMenuItem = New ToolStripMenuItem() ToolStripMenuItemtoJSON = New ToolStripMenuItem()
DarkModeToolStripMenuItem = New ToolStripMenuItem() ToolStripMenuItemtoCSV = New ToolStripMenuItem()
FileMenuStrip = New MenuStrip() ToolStripMenuItemAbout = New ToolStripMenuItem()
ToolsToolStripMenuTools = New ToolStripMenuItem() ToolStripMenuItemDeveloper = New ToolStripMenuItem()
AboutToolStripMenuItem = New ToolStripMenuItem() ToolStripMenuItemCheckUpdates = New ToolStripMenuItem()
DeveloperToolStripMenuItem = New ToolStripMenuItem() ToolStripMenuItemQuit = New ToolStripMenuItem()
CheckUpdatesToolStripMenuItem = New ToolStripMenuItem()
ToolStripSeparator2 = New ToolStripSeparator()
QuitToolStripMenuItem = New ToolStripMenuItem()
LimitNumericUpDown = New NumericUpDown() LimitNumericUpDown = New NumericUpDown()
ToolTip1 = New ToolTip(components) PictureBoxLogo = New PictureBox()
ContextMenuStrip1.SuspendLayout() LabelRPST = New Label()
FileMenuStrip.SuspendLayout() ContextMenuStripRightClick.SuspendLayout()
CType(LimitNumericUpDown, ComponentModel.ISupportInitialize).BeginInit() CType(LimitNumericUpDown, ComponentModel.ISupportInitialize).BeginInit()
CType(PictureBoxLogo, ComponentModel.ISupportInitialize).BeginInit()
SuspendLayout() SuspendLayout()
' '
' KeywordTextBox ' KeywordTextBox
' '
KeywordTextBox.BackColor = SystemColors.Window KeywordTextBox.BackColor = SystemColors.Window
KeywordTextBox.ForeColor = SystemColors.WindowText KeywordTextBox.ForeColor = SystemColors.WindowText
KeywordTextBox.Location = New Point(89, 60) KeywordTextBox.Location = New Point(159, 75)
KeywordTextBox.Name = "KeywordTextBox" KeywordTextBox.Name = "KeywordTextBox"
KeywordTextBox.PlaceholderText = "Keyword" KeywordTextBox.PlaceholderText = "Keyword"
KeywordTextBox.Size = New Size(100, 23) KeywordTextBox.Size = New Size(100, 23)
@@ -65,26 +63,26 @@ Partial Class StartForm
' '
' SubredditTextBox ' SubredditTextBox
' '
SubredditTextBox.Location = New Point(89, 92) SubredditTextBox.Location = New Point(159, 106)
SubredditTextBox.Name = "SubredditTextBox" SubredditTextBox.Name = "SubredditTextBox"
SubredditTextBox.PlaceholderText = "Subreddit" SubredditTextBox.PlaceholderText = "Subreddit"
SubredditTextBox.Size = New Size(100, 23) SubredditTextBox.Size = New Size(100, 23)
SubredditTextBox.TabIndex = 4 SubredditTextBox.TabIndex = 4
' '
' ScrapeButton ' ButtonScrape
' '
ScrapeButton.Location = New Point(257, 191) ButtonScrape.Location = New Point(208, 29)
ScrapeButton.Name = "ScrapeButton" ButtonScrape.Name = "ButtonScrape"
ScrapeButton.Size = New Size(76, 28) ButtonScrape.Size = New Size(51, 28)
ScrapeButton.TabIndex = 6 ButtonScrape.TabIndex = 6
ScrapeButton.Text = "Scrape" ButtonScrape.Text = "Scrape"
ScrapeButton.UseVisualStyleBackColor = True ButtonScrape.UseVisualStyleBackColor = True
' '
' TimeframeComboBox ' TimeframeComboBox
' '
TimeframeComboBox.FormattingEnabled = True TimeframeComboBox.FormattingEnabled = True
TimeframeComboBox.Items.AddRange(New Object() {"Hour", "Day", "Week", "Month", "Year"}) TimeframeComboBox.Items.AddRange(New Object() {"Hour", "Day", "Week", "Month", "Year"})
TimeframeComboBox.Location = New Point(89, 191) TimeframeComboBox.Location = New Point(159, 200)
TimeframeComboBox.Name = "TimeframeComboBox" TimeframeComboBox.Name = "TimeframeComboBox"
TimeframeComboBox.Size = New Size(100, 23) TimeframeComboBox.Size = New Size(100, 23)
TimeframeComboBox.TabIndex = 8 TimeframeComboBox.TabIndex = 8
@@ -94,7 +92,7 @@ Partial Class StartForm
' '
ListingComboBox.FormattingEnabled = True ListingComboBox.FormattingEnabled = True
ListingComboBox.Items.AddRange(New Object() {"Controversial", "Hot", "Best", "New", "Rising"}) ListingComboBox.Items.AddRange(New Object() {"Controversial", "Hot", "Best", "New", "Rising"})
ListingComboBox.Location = New Point(89, 157) ListingComboBox.Location = New Point(159, 168)
ListingComboBox.Name = "ListingComboBox" ListingComboBox.Name = "ListingComboBox"
ListingComboBox.Size = New Size(100, 23) ListingComboBox.Size = New Size(100, 23)
ListingComboBox.TabIndex = 9 ListingComboBox.TabIndex = 9
@@ -103,159 +101,136 @@ Partial Class StartForm
' LabelKeyword ' LabelKeyword
' '
LabelKeyword.AutoEllipsis = True LabelKeyword.AutoEllipsis = True
LabelKeyword.Font = New Font("Segoe UI Semibold", 9F, FontStyle.Underline, GraphicsUnit.Point) LabelKeyword.Font = New Font("Segoe UI Semibold", 9F, FontStyle.Bold Or FontStyle.Underline, GraphicsUnit.Point)
LabelKeyword.ForeColor = Color.Black LabelKeyword.ForeColor = Color.Black
LabelKeyword.Location = New Point(12, 60) LabelKeyword.Location = New Point(19, 78)
LabelKeyword.Name = "LabelKeyword" LabelKeyword.Name = "LabelKeyword"
LabelKeyword.Size = New Size(56, 23) LabelKeyword.Size = New Size(71, 20)
LabelKeyword.TabIndex = 10 LabelKeyword.TabIndex = 10
LabelKeyword.Text = "Keyword" LabelKeyword.Text = "Keyword:"
' '
' LabelSubreddit ' LabelSubreddit
' '
LabelSubreddit.AutoEllipsis = True LabelSubreddit.AutoEllipsis = True
LabelSubreddit.Font = New Font("Segoe UI Semibold", 9F, FontStyle.Underline, GraphicsUnit.Point) LabelSubreddit.Font = New Font("Segoe UI Semibold", 9F, FontStyle.Bold Or FontStyle.Underline, GraphicsUnit.Point)
LabelSubreddit.ForeColor = Color.Black LabelSubreddit.ForeColor = Color.Black
LabelSubreddit.Location = New Point(12, 92) LabelSubreddit.Location = New Point(19, 109)
LabelSubreddit.Name = "LabelSubreddit" LabelSubreddit.Name = "LabelSubreddit"
LabelSubreddit.Size = New Size(63, 23) LabelSubreddit.Size = New Size(71, 23)
LabelSubreddit.TabIndex = 11 LabelSubreddit.TabIndex = 11
LabelSubreddit.Text = "Subreddit" LabelSubreddit.Text = "Subreddit:"
' '
' LabelLimit ' LabelLimit
' '
LabelLimit.AutoEllipsis = True LabelLimit.AutoEllipsis = True
LabelLimit.Font = New Font("Segoe UI Semibold", 9F, FontStyle.Bold Or FontStyle.Underline, GraphicsUnit.Point) LabelLimit.Font = New Font("Segoe UI Semibold", 9F, FontStyle.Bold Or FontStyle.Underline, GraphicsUnit.Point)
LabelLimit.ForeColor = Color.Black LabelLimit.ForeColor = Color.Black
LabelLimit.Location = New Point(12, 125) LabelLimit.Location = New Point(19, 137)
LabelLimit.Name = "LabelLimit" LabelLimit.Name = "LabelLimit"
LabelLimit.Size = New Size(56, 23) LabelLimit.Size = New Size(56, 23)
LabelLimit.TabIndex = 12 LabelLimit.TabIndex = 12
LabelLimit.Text = "Limit" LabelLimit.Text = "Limit:"
' '
' LabelListing ' LabelListing
' '
LabelListing.AutoEllipsis = True LabelListing.AutoEllipsis = True
LabelListing.Font = New Font("Segoe UI Semibold", 9F, FontStyle.Bold Or FontStyle.Underline, GraphicsUnit.Point) LabelListing.Font = New Font("Segoe UI Semibold", 9F, FontStyle.Bold Or FontStyle.Underline, GraphicsUnit.Point)
LabelListing.ForeColor = Color.Black LabelListing.ForeColor = Color.Black
LabelListing.Location = New Point(12, 157) LabelListing.Location = New Point(19, 168)
LabelListing.Name = "LabelListing" LabelListing.Name = "LabelListing"
LabelListing.Size = New Size(56, 23) LabelListing.Size = New Size(56, 23)
LabelListing.TabIndex = 13 LabelListing.TabIndex = 13
LabelListing.Text = "Listing" LabelListing.Text = "Listing:"
' '
' LabelTimeframe ' LabelTimeframe
' '
LabelTimeframe.AutoEllipsis = True LabelTimeframe.AutoEllipsis = True
LabelTimeframe.Font = New Font("Segoe UI Semibold", 9F, FontStyle.Bold Or FontStyle.Underline, GraphicsUnit.Point) LabelTimeframe.Font = New Font("Segoe UI Semibold", 9F, FontStyle.Bold Or FontStyle.Underline, GraphicsUnit.Point)
LabelTimeframe.ForeColor = Color.Black LabelTimeframe.ForeColor = Color.Black
LabelTimeframe.Location = New Point(12, 191) LabelTimeframe.Location = New Point(19, 200)
LabelTimeframe.Name = "LabelTimeframe" LabelTimeframe.Name = "LabelTimeframe"
LabelTimeframe.Size = New Size(71, 23) LabelTimeframe.Size = New Size(81, 23)
LabelTimeframe.TabIndex = 14 LabelTimeframe.TabIndex = 14
LabelTimeframe.Text = "Timeframe" LabelTimeframe.Text = "Timeframe:"
' '
' ContextMenuStrip1 ' ContextMenuStripRightClick
' '
ContextMenuStrip1.Items.AddRange(New ToolStripItem() {SaveResultsStripMenuItem, DarkModeToolStripMenuItem}) ContextMenuStripRightClick.Items.AddRange(New ToolStripItem() {ToolStripMenuItemDarkMode, ToolStripMenuItemSavePosts, ToolStripMenuItemAbout, ToolStripMenuItemDeveloper, ToolStripMenuItemCheckUpdates, ToolStripMenuItemQuit})
ContextMenuStrip1.Name = "ContextMenuStrip1" ContextMenuStripRightClick.Name = "ContextMenuStrip1"
ContextMenuStrip1.Size = New Size(144, 48) ContextMenuStripRightClick.Size = New Size(154, 136)
' '
' SaveResultsStripMenuItem ' ToolStripMenuItemDarkMode
' '
SaveResultsStripMenuItem.AutoToolTip = True ToolStripMenuItemDarkMode.AutoToolTip = True
SaveResultsStripMenuItem.DropDownItems.AddRange(New ToolStripItem() {JSONToolStripMenuItem, CSVToolStripMenuItem}) ToolStripMenuItemDarkMode.CheckOnClick = True
SaveResultsStripMenuItem.Image = CType(resources.GetObject("SaveResultsStripMenuItem.Image"), Image) ToolStripMenuItemDarkMode.Image = CType(resources.GetObject("ToolStripMenuItemDarkMode.Image"), Image)
SaveResultsStripMenuItem.Name = "SaveResultsStripMenuItem" ToolStripMenuItemDarkMode.Name = "ToolStripMenuItemDarkMode"
SaveResultsStripMenuItem.Size = New Size(143, 22) ToolStripMenuItemDarkMode.Size = New Size(153, 22)
SaveResultsStripMenuItem.Text = "Save posts to" ToolStripMenuItemDarkMode.Text = "Dark Mode"
' '
' JSONToolStripMenuItem ' ToolStripMenuItemSavePosts
' '
JSONToolStripMenuItem.AutoToolTip = True ToolStripMenuItemSavePosts.AutoToolTip = True
JSONToolStripMenuItem.CheckOnClick = True ToolStripMenuItemSavePosts.DropDownItems.AddRange(New ToolStripItem() {ToolStripMenuItemtoJSON, ToolStripMenuItemtoCSV})
JSONToolStripMenuItem.Image = CType(resources.GetObject("JSONToolStripMenuItem.Image"), Image) ToolStripMenuItemSavePosts.Image = CType(resources.GetObject("ToolStripMenuItemSavePosts.Image"), Image)
JSONToolStripMenuItem.Name = "JSONToolStripMenuItem" ToolStripMenuItemSavePosts.Name = "ToolStripMenuItemSavePosts"
JSONToolStripMenuItem.Size = New Size(185, 22) ToolStripMenuItemSavePosts.Size = New Size(153, 22)
JSONToolStripMenuItem.Text = "JSON" ToolStripMenuItemSavePosts.Text = "Save Posts"
ToolStripMenuItemSavePosts.ToolTipText = "Save found posts to..."
' '
' CSVToolStripMenuItem ' ToolStripMenuItemtoJSON
' '
CSVToolStripMenuItem.AutoToolTip = True ToolStripMenuItemtoJSON.AutoToolTip = True
CSVToolStripMenuItem.Enabled = False ToolStripMenuItemtoJSON.CheckOnClick = True
CSVToolStripMenuItem.Image = CType(resources.GetObject("CSVToolStripMenuItem.Image"), Image) ToolStripMenuItemtoJSON.Image = CType(resources.GetObject("ToolStripMenuItemtoJSON.Image"), Image)
CSVToolStripMenuItem.Name = "CSVToolStripMenuItem" ToolStripMenuItemtoJSON.Name = "ToolStripMenuItemtoJSON"
CSVToolStripMenuItem.Size = New Size(185, 22) ToolStripMenuItemtoJSON.Size = New Size(116, 22)
CSVToolStripMenuItem.Text = "CSV (coming soon...)" ToolStripMenuItemtoJSON.Text = "to JSON"
' '
' DarkModeToolStripMenuItem ' ToolStripMenuItemtoCSV
' '
DarkModeToolStripMenuItem.AutoToolTip = True ToolStripMenuItemtoCSV.AutoToolTip = True
DarkModeToolStripMenuItem.CheckOnClick = True ToolStripMenuItemtoCSV.Enabled = False
DarkModeToolStripMenuItem.Image = CType(resources.GetObject("DarkModeToolStripMenuItem.Image"), Image) ToolStripMenuItemtoCSV.Image = CType(resources.GetObject("ToolStripMenuItemtoCSV.Image"), Image)
DarkModeToolStripMenuItem.Name = "DarkModeToolStripMenuItem" ToolStripMenuItemtoCSV.Name = "ToolStripMenuItemtoCSV"
DarkModeToolStripMenuItem.Size = New Size(143, 22) ToolStripMenuItemtoCSV.Size = New Size(116, 22)
DarkModeToolStripMenuItem.Text = "Dark mode" ToolStripMenuItemtoCSV.Text = "to CSV"
' '
' FileMenuStrip ' ToolStripMenuItemAbout
' '
FileMenuStrip.BackColor = Color.Transparent ToolStripMenuItemAbout.AutoToolTip = True
FileMenuStrip.Items.AddRange(New ToolStripItem() {ToolsToolStripMenuTools}) ToolStripMenuItemAbout.Image = CType(resources.GetObject("ToolStripMenuItemAbout.Image"), Image)
FileMenuStrip.Location = New Point(0, 0) ToolStripMenuItemAbout.Name = "ToolStripMenuItemAbout"
FileMenuStrip.Name = "FileMenuStrip" ToolStripMenuItemAbout.Size = New Size(153, 22)
FileMenuStrip.Size = New Size(355, 24) ToolStripMenuItemAbout.Text = "About"
FileMenuStrip.TabIndex = 0
FileMenuStrip.Text = "MenuStrip1"
' '
' ToolsToolStripMenuTools ' ToolStripMenuItemDeveloper
' '
ToolsToolStripMenuTools.DropDownItems.AddRange(New ToolStripItem() {AboutToolStripMenuItem, DeveloperToolStripMenuItem, CheckUpdatesToolStripMenuItem, ToolStripSeparator2, QuitToolStripMenuItem}) ToolStripMenuItemDeveloper.AutoToolTip = True
ToolsToolStripMenuTools.Font = New Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point) ToolStripMenuItemDeveloper.Image = CType(resources.GetObject("ToolStripMenuItemDeveloper.Image"), Image)
ToolsToolStripMenuTools.ForeColor = Color.White ToolStripMenuItemDeveloper.Name = "ToolStripMenuItemDeveloper"
ToolsToolStripMenuTools.Image = CType(resources.GetObject("ToolsToolStripMenuTools.Image"), Image) ToolStripMenuItemDeveloper.Size = New Size(153, 22)
ToolsToolStripMenuTools.Name = "ToolsToolStripMenuTools" ToolStripMenuItemDeveloper.Text = "Developer"
ToolsToolStripMenuTools.Size = New Size(28, 20)
' '
' AboutToolStripMenuItem ' ToolStripMenuItemCheckUpdates
' '
AboutToolStripMenuItem.AutoToolTip = True ToolStripMenuItemCheckUpdates.AutoToolTip = True
AboutToolStripMenuItem.Image = CType(resources.GetObject("AboutToolStripMenuItem.Image"), Image) ToolStripMenuItemCheckUpdates.Image = CType(resources.GetObject("ToolStripMenuItemCheckUpdates.Image"), Image)
AboutToolStripMenuItem.Name = "AboutToolStripMenuItem" ToolStripMenuItemCheckUpdates.Name = "ToolStripMenuItemCheckUpdates"
AboutToolStripMenuItem.Size = New Size(152, 22) ToolStripMenuItemCheckUpdates.Size = New Size(153, 22)
AboutToolStripMenuItem.Text = "About" ToolStripMenuItemCheckUpdates.Text = "Check Updates"
' '
' DeveloperToolStripMenuItem ' ToolStripMenuItemQuit
' '
DeveloperToolStripMenuItem.AutoToolTip = True ToolStripMenuItemQuit.AutoToolTip = True
DeveloperToolStripMenuItem.Image = CType(resources.GetObject("DeveloperToolStripMenuItem.Image"), Image) ToolStripMenuItemQuit.Image = CType(resources.GetObject("ToolStripMenuItemQuit.Image"), Image)
DeveloperToolStripMenuItem.Name = "DeveloperToolStripMenuItem" ToolStripMenuItemQuit.Name = "ToolStripMenuItemQuit"
DeveloperToolStripMenuItem.Size = New Size(152, 22) ToolStripMenuItemQuit.Size = New Size(153, 22)
DeveloperToolStripMenuItem.Text = "Developer" ToolStripMenuItemQuit.Text = "Quit"
'
' CheckUpdatesToolStripMenuItem
'
CheckUpdatesToolStripMenuItem.AutoToolTip = True
CheckUpdatesToolStripMenuItem.Image = CType(resources.GetObject("CheckUpdatesToolStripMenuItem.Image"), Image)
CheckUpdatesToolStripMenuItem.Name = "CheckUpdatesToolStripMenuItem"
CheckUpdatesToolStripMenuItem.Size = New Size(152, 22)
CheckUpdatesToolStripMenuItem.Text = "Check updates"
'
' ToolStripSeparator2
'
ToolStripSeparator2.Name = "ToolStripSeparator2"
ToolStripSeparator2.Size = New Size(149, 6)
'
' QuitToolStripMenuItem
'
QuitToolStripMenuItem.AutoToolTip = True
QuitToolStripMenuItem.Image = CType(resources.GetObject("QuitToolStripMenuItem.Image"), Image)
QuitToolStripMenuItem.Name = "QuitToolStripMenuItem"
QuitToolStripMenuItem.Size = New Size(152, 22)
QuitToolStripMenuItem.Text = "Quit"
' '
' LimitNumericUpDown ' LimitNumericUpDown
' '
LimitNumericUpDown.Location = New Point(89, 125) LimitNumericUpDown.Location = New Point(159, 137)
LimitNumericUpDown.Minimum = New Decimal(New Integer() {5, 0, 0, 0}) LimitNumericUpDown.Minimum = New Decimal(New Integer() {5, 0, 0, 0})
LimitNumericUpDown.Name = "LimitNumericUpDown" LimitNumericUpDown.Name = "LimitNumericUpDown"
LimitNumericUpDown.ReadOnly = True LimitNumericUpDown.ReadOnly = True
@@ -263,43 +238,64 @@ Partial Class StartForm
LimitNumericUpDown.TabIndex = 15 LimitNumericUpDown.TabIndex = 15
LimitNumericUpDown.Value = New Decimal(New Integer() {10, 0, 0, 0}) LimitNumericUpDown.Value = New Decimal(New Integer() {10, 0, 0, 0})
' '
' PictureBoxLogo
'
PictureBoxLogo.BackColor = Color.Transparent
PictureBoxLogo.Image = CType(resources.GetObject("PictureBoxLogo.Image"), Image)
PictureBoxLogo.Location = New Point(19, 12)
PictureBoxLogo.Name = "PictureBoxLogo"
PictureBoxLogo.Size = New Size(41, 45)
PictureBoxLogo.SizeMode = PictureBoxSizeMode.StretchImage
PictureBoxLogo.TabIndex = 17
PictureBoxLogo.TabStop = False
'
' LabelRPST
'
LabelRPST.AutoSize = True
LabelRPST.BackColor = Color.Transparent
LabelRPST.Font = New Font("Ink Free", 9F, FontStyle.Regular, GraphicsUnit.Point)
LabelRPST.Location = New Point(50, 51)
LabelRPST.Name = "LabelRPST"
LabelRPST.Size = New Size(36, 15)
LabelRPST.TabIndex = 18
LabelRPST.Text = "RPST"
'
' StartForm ' StartForm
' '
AutoScaleDimensions = New SizeF(7F, 15F) AutoScaleDimensions = New SizeF(7F, 15F)
AutoScaleMode = AutoScaleMode.Font AutoScaleMode = AutoScaleMode.Font
BackColor = SystemColors.Control BackColor = SystemColors.Control
ClientSize = New Size(355, 255) ClientSize = New Size(281, 244)
ContextMenuStrip = ContextMenuStrip1 ContextMenuStrip = ContextMenuStripRightClick
Controls.Add(LimitNumericUpDown) Controls.Add(LabelRPST)
Controls.Add(FileMenuStrip) Controls.Add(PictureBoxLogo)
Controls.Add(TimeframeComboBox)
Controls.Add(KeywordTextBox)
Controls.Add(LabelTimeframe) Controls.Add(LabelTimeframe)
Controls.Add(LabelListing)
Controls.Add(LabelLimit)
Controls.Add(LabelSubreddit)
Controls.Add(LabelKeyword) Controls.Add(LabelKeyword)
Controls.Add(ListingComboBox) Controls.Add(ListingComboBox)
Controls.Add(TimeframeComboBox) Controls.Add(LimitNumericUpDown)
Controls.Add(LabelListing)
Controls.Add(ButtonScrape)
Controls.Add(LabelLimit)
Controls.Add(LabelSubreddit)
Controls.Add(SubredditTextBox) Controls.Add(SubredditTextBox)
Controls.Add(ScrapeButton)
Controls.Add(KeywordTextBox)
FormBorderStyle = FormBorderStyle.FixedSingle FormBorderStyle = FormBorderStyle.FixedSingle
Icon = CType(resources.GetObject("$this.Icon"), Icon) Icon = CType(resources.GetObject("$this.Icon"), Icon)
MainMenuStrip = FileMenuStrip
MaximizeBox = False MaximizeBox = False
Name = "StartForm" Name = "StartForm"
StartPosition = FormStartPosition.CenterScreen StartPosition = FormStartPosition.CenterScreen
Text = "ProgramName ProgramVersion" Text = "ProgramName ProgramVersion"
ContextMenuStrip1.ResumeLayout(False) ContextMenuStripRightClick.ResumeLayout(False)
FileMenuStrip.ResumeLayout(False)
FileMenuStrip.PerformLayout()
CType(LimitNumericUpDown, ComponentModel.ISupportInitialize).EndInit() CType(LimitNumericUpDown, ComponentModel.ISupportInitialize).EndInit()
CType(PictureBoxLogo, ComponentModel.ISupportInitialize).EndInit()
ResumeLayout(False) ResumeLayout(False)
PerformLayout() PerformLayout()
End Sub End Sub
Friend WithEvents KeywordTextBox As TextBox Friend WithEvents KeywordTextBox As TextBox
Friend WithEvents SubredditTextBox As TextBox Friend WithEvents SubredditTextBox As TextBox
Friend WithEvents ScrapeButton As Button Friend WithEvents ButtonScrape As Button
Friend WithEvents TimeframeComboBox As ComboBox Friend WithEvents TimeframeComboBox As ComboBox
Friend WithEvents ListingComboBox As ComboBox Friend WithEvents ListingComboBox As ComboBox
Friend WithEvents LabelKeyword As Label Friend WithEvents LabelKeyword As Label
@@ -307,18 +303,16 @@ Partial Class StartForm
Friend WithEvents LabelLimit As Label Friend WithEvents LabelLimit As Label
Friend WithEvents LabelListing As Label Friend WithEvents LabelListing As Label
Friend WithEvents LabelTimeframe As Label Friend WithEvents LabelTimeframe As Label
Friend WithEvents ContextMenuStrip1 As ContextMenuStrip Friend WithEvents ContextMenuStripRightClick As ContextMenuStrip
Friend WithEvents FileMenuStrip As MenuStrip Friend WithEvents ToolStripMenuItemSavePosts As ToolStripMenuItem
Friend WithEvents ToolsToolStripMenuTools As ToolStripMenuItem Friend WithEvents ToolStripMenuItemtoJSON As ToolStripMenuItem
Friend WithEvents AboutToolStripMenuItem As ToolStripMenuItem Friend WithEvents ToolStripMenuItemtoCSV As ToolStripMenuItem
Friend WithEvents DeveloperToolStripMenuItem As ToolStripMenuItem
Friend WithEvents ToolStripSeparator2 As ToolStripSeparator
Friend WithEvents QuitToolStripMenuItem As ToolStripMenuItem
Friend WithEvents SaveResultsStripMenuItem As ToolStripMenuItem
Friend WithEvents CheckUpdatesToolStripMenuItem As ToolStripMenuItem
Friend WithEvents JSONToolStripMenuItem As ToolStripMenuItem
Friend WithEvents CSVToolStripMenuItem As ToolStripMenuItem
Friend WithEvents LimitNumericUpDown As NumericUpDown Friend WithEvents LimitNumericUpDown As NumericUpDown
Friend WithEvents DarkModeToolStripMenuItem As ToolStripMenuItem Friend WithEvents ToolStripMenuItemDarkMode As ToolStripMenuItem
Friend WithEvents ToolTip1 As ToolTip Friend WithEvents ToolStripMenuItemAbout As ToolStripMenuItem
Friend WithEvents ToolStripMenuItemDeveloper As ToolStripMenuItem
Friend WithEvents ToolStripMenuItemCheckUpdates As ToolStripMenuItem
Friend WithEvents ToolStripMenuItemQuit As ToolStripMenuItem
Friend WithEvents PictureBoxLogo As PictureBox
Friend WithEvents LabelRPST As Label
End Class End Class

File diff suppressed because it is too large Load Diff

View File

@@ -13,8 +13,8 @@ Public Class StartForm
''' </summary> ''' </summary>
''' <param name="sender">The sender of the event.</param> ''' <param name="sender">The sender of the event.</param>
''' <param name="e">The EventArgs instance containing the event data.</param> ''' <param name="e">The EventArgs instance containing the event data.</param>
Private Sub ScrapeButton_Click(sender As Object, e As EventArgs) Handles ScrapeButton.Click Private Sub ButtonScrape_Click(sender As Object, e As EventArgs) Handles ButtonScrape.Click
Utilities.ProcessRedditPosts(JSONToolStripMenuItem) Utilities.ProcessRedditPosts(ToolStripMenuItemtoJSON)
End Sub End Sub
@@ -29,67 +29,7 @@ Public Class StartForm
settings.ToggleDarkMode(settings.DarkMode) settings.ToggleDarkMode(settings.DarkMode)
Utilities.PathFinder() Utilities.PathFinder()
Utilities.LogFirstTimeLaunch() Utilities.LogFirstTimeLaunch()
Me.Text = My.Application.Info.AssemblyName Me.Text = $"{My.Application.Info.AssemblyName} v{My.Application.Info.Version}"
End Sub
''' <summary>
''' Event handler for the 'About' menu item click.
''' It shows the 'About' box.
''' </summary>
''' <param name="sender">The source of the event.</param>
''' <param name="e">An EventArgs that contains the event data.</param>
Private Sub AboutToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AboutToolStripMenuItem.Click
AboutBox.Show()
End Sub
''' <summary>
''' Event handler for the 'Quit' menu item click.
''' It asks the user for confirmation and closes the program if the user agrees.
''' </summary>
''' <param name="sender">The source of the event.</param>
''' <param name="e">An EventArgs that contains the event data.</param>
Private Sub QuitToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles QuitToolStripMenuItem.Click
Dim result As DialogResult = MessageBox.Show("This will close the program, continue?", "Quit", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If result = DialogResult.Yes Then
Me.Close()
End If
End Sub
''' <summary>
''' Event handler for the 'Developer' menu item click.
''' It shows the 'Developer' dialog box.
''' </summary>
''' <param name="sender">The source of the event.</param>
''' <param name="e">An EventArgs that contains the event data.</param>
Private Sub DeveloperToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DeveloperToolStripMenuItem.Click
DeveloperForm.ShowDialog()
End Sub
''' <summary>
''' Event handler for the 'Check Updates' menu item click.
''' It checks for application updates and provides update information if a newer version is available.
''' </summary>
''' <param name="sender">The source of the event.</param>
''' <param name="e">An EventArgs that contains the event data.</param>
Private Sub CheckUpdatesToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CheckUpdatesToolStripMenuItem.Click
Dim data As JObject = ApiHandler.CheckUpdates()
If data("tag_name").ToString = $"{My.Application.Info.Version}" Then
MessageBox.Show($"You're running the current version v{My.Application.Info.Version} of {My.Application.Info.ProductName}. Check again soon! :)", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
Dim confirm As DialogResult = MessageBox.Show($"A new version v{data("tag_name")} of {My.Application.Info.ProductName} is available, would you like to get it?
What's new in v{data("tag_name")}?
{data("body")}
", "Update", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If confirm = DialogResult.Yes Then
Shell($"cmd /c start https://github.com/bellingcat/reddit-post-scraping-tool/releases/tag/{data("tag_name")}")
End If
End If
End Sub End Sub
@@ -99,7 +39,65 @@ What's new in v{data("tag_name")}?
''' </summary> ''' </summary>
''' <param name="sender">The source of the event.</param> ''' <param name="sender">The source of the event.</param>
''' <param name="e">An EventArgs that contains the event data.</param> ''' <param name="e">An EventArgs that contains the event data.</param>
Private Sub DarkModeToolStripMenuItem_CheckedChanged(sender As Object, e As EventArgs) Handles DarkModeToolStripMenuItem.CheckedChanged Private Sub DarkModeToolStripMenuItem_CheckedChanged(sender As Object, e As EventArgs) Handles ToolStripMenuItemDarkMode.CheckedChanged
settings.ToggleDarkMode(DarkModeToolStripMenuItem.Checked) settings.ToggleDarkMode(ToolStripMenuItemDarkMode.Checked)
End Sub
''' <summary>
''' Event handler for the 'About' menu item click.
''' It shows the 'About' box.
''' </summary>
''' <param name="sender">The source of the event.</param>
''' <param name="e">An EventArgs that contains the event data.</param>
Private Sub ToolStripMenuItemAbout_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItemAbout.Click
AboutBox.Show()
End Sub
''' <summary>
''' Event handler for the 'Developer' menu item click.
''' It shows the 'Developer' dialog box.
''' </summary>
''' <param name="sender">The source of the event.</param>
''' <param name="e">An EventArgs that contains the event data.</param>
Private Sub ToolStripMenuItemDeveloper_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItemDeveloper.Click
DeveloperBox.ShowDialog()
End Sub
''' <summary>
''' Event handler for the 'Check Updates' menu item click.
''' It checks for application updates and provides update information if a newer version is available.
''' </summary>
''' <param name="sender">The source of the event.</param>
''' <param name="e">An EventArgs that contains the event data.</param>
Private Sub ToolStripMenuItemCheckUpdates_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItemCheckUpdates.Click
Dim data As JObject = ApiHandler.CheckUpdates()
If data("tag_name").ToString = $"{My.Application.Info.Version}" Then
MessageBox.Show($"You're running the current version v{My.Application.Info.Version} of {My.Application.Info.ProductName}. Check again soon! :)", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
Dim confirm As DialogResult = MessageBox.Show($"A new version v{data("tag_name")} of {My.Application.Info.ProductName} is available, would you like to get it?
{data("body")}
", "Update", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If confirm = DialogResult.Yes Then
Shell($"cmd /c start {data("html_url")}")
End If
End If
End Sub
''' <summary>
''' Event handler for the 'Quit' menu item click.
''' It asks the user for confirmation and closes the program if the user agrees.
''' </summary>
''' <param name="sender">The source of the event.</param>
''' <param name="e">An EventArgs that contains the event data.</param>
Private Sub ToolStripMenuItemQuit_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItemQuit.Click
Dim result As DialogResult = MessageBox.Show("This will close the program, continue?", "Quit", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If result = DialogResult.Yes Then
Me.Close()
End If
End Sub End Sub
End Class End Class

View File

@@ -17,7 +17,7 @@ Public Class Utilities
If inputs.HasValue Then If inputs.HasValue Then
' Initialize the DataGridView ' Initialize the DataGridView
DataGridViewHandler.AddColumn(PostsForm.DataGridViewPosts) DataGridViewHandler.AddColumn(ResultsForm.DataGridViewResults)
' Fetch Reddit posts based on the inputs ' Fetch Reddit posts based on the inputs
Dim processor As New PostsProcessor() Dim processor As New PostsProcessor()
@@ -29,17 +29,17 @@ Public Class Utilities
For Each post In posts("data")("children") For Each post In posts("data")("children")
totalPosts += 1 totalPosts += 1
' Check if the post contains the keyword ' Check if the post contains the keyword
If PostsProcessor.PostContainsKeyword(post, inputs.Value.Keyword.ToLower(System.Globalization.CultureInfo.InvariantCulture)) Then If PostsProcessor.PostContainsKeyword(post, inputs.Value.Keyword.ToLower(Globalization.CultureInfo.InvariantCulture)) Then
' Add the post to the DataGridView ' Add the post to the DataGridView
DataGridViewHandler.AddRow(PostsForm.DataGridViewPosts, post, totalPosts) DataGridViewHandler.AddRow(ResultsForm.DataGridViewResults, post, totalPosts)
PostsForm.Show() ResultsForm.Show()
keywordFound = True keywordFound = True
End If End If
Next Next
' Check if the keyword was found in any posts ' Check if the keyword was found in any posts
If Not keywordFound Then If Not keywordFound Then
MessageBox.Show($"Keyword `{inputs.Value.Keyword}` was not found in any of the " + posts("data")("children").Count.ToString(System.Globalization.CultureInfo.InvariantCulture) _ MessageBox.Show($"Keyword `{inputs.Value.Keyword}` was not found in any of the " + posts("data")("children").Count.ToString(Globalization.CultureInfo.InvariantCulture) _
+ $" {inputs.Value.Listing} posts from r/{inputs.Value.Subreddit}", "Not Found", MessageBoxButtons.OK, MessageBoxIcon.Warning) + $" {inputs.Value.Listing} posts from r/{inputs.Value.Subreddit}", "Not Found", MessageBoxButtons.OK, MessageBoxIcon.Warning)
End If End If
@@ -48,7 +48,6 @@ Public Class Utilities
Utilities.SavePostsToJson(posts("data")) Utilities.SavePostsToJson(posts("data"))
End If End If
Else Else
MessageBox.Show("Inputs cannot be empty. Please enter a keyword and a subreddit.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If End If
End Sub End Sub
@@ -88,25 +87,22 @@ Public Class Utilities
Public Shared Function CollectInputs() As (Keyword As String, Subreddit As String, Listing As String, Limit As Integer, Timeframe As String)? Public Shared Function CollectInputs() As (Keyword As String, Subreddit As String, Listing As String, Limit As Integer, Timeframe As String)?
Dim keyword As String = StartForm.KeywordTextBox.Text.Trim() Dim keyword As String = StartForm.KeywordTextBox.Text.Trim()
Dim subreddit As String = StartForm.SubredditTextBox.Text.Trim() Dim subreddit As String = StartForm.SubredditTextBox.Text.Trim()
' Convert the Keyword and Subreddit to lowercase using InvariantCulture ' Convert the Listing and Subreddit to lowercase using InvariantCulture
Dim listing As String = If(String.IsNullOrEmpty(StartForm.ListingComboBox.Text), "top", StartForm.ListingComboBox.Text.ToLower(System.Globalization.CultureInfo.InvariantCulture).Trim()) Dim listing As String = If(String.IsNullOrEmpty(StartForm.ListingComboBox.Text), "top", StartForm.ListingComboBox.Text.ToLower(Globalization.CultureInfo.InvariantCulture).Trim())
Dim timeframe As String = If(String.IsNullOrEmpty(StartForm.TimeframeComboBox.Text), "all", StartForm.TimeframeComboBox.Text.ToLower(Globalization.CultureInfo.InvariantCulture).Trim())
Dim limit As Integer = StartForm.LimitNumericUpDown.Value Dim limit As Integer = StartForm.LimitNumericUpDown.Value
Dim timeframe As String = If(String.IsNullOrEmpty(StartForm.TimeframeComboBox.Text), "all", StartForm.TimeframeComboBox.Text.ToLower(System.Globalization.CultureInfo.InvariantCulture).Trim())
' Validate inputs ' Validate inputs
If String.IsNullOrEmpty(keyword) Then If String.IsNullOrEmpty(keyword) AndAlso String.IsNullOrEmpty(subreddit) Then
MessageBox.Show("Keyword should not be empty", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning) MessageBox.Show("Keyword and Subreddit fields should not be empty.", "Invalid Inputs", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Return Nothing
ElseIf String.IsNullOrEmpty(keyword) Then
MessageBox.Show("Keyword field should not be empty.", "Invalid Input", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Return Nothing
ElseIf String.IsNullOrEmpty(subreddit) Then
MessageBox.Show("Subreddit field should not be empty.", "Invalid Input", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Return Nothing Return Nothing
End If End If
If String.IsNullOrEmpty(subreddit) Then
MessageBox.Show("Subreddit should not be empty", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Return Nothing
End If
If limit > 100 Then
MessageBox.Show("Limit should not be over 100. Defaulting to 10", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)
limit = 10
End If
Return (keyword, subreddit, listing, limit, timeframe) Return (keyword, subreddit, listing, limit, timeframe)
End Function End Function
@@ -174,7 +170,6 @@ First launched on: {DateTime.Now}"
LicenseNotice() LicenseNotice()
File.WriteAllText(filePath, textToWrite) File.WriteAllText(filePath, textToWrite)
Else Else
' DO NOTHING
End If End If
End Sub End Sub
End Class End Class

View File

@@ -7,7 +7,7 @@ packages = ["rpst"]
[project] [project]
name = "reddit-post-scraping-tool" name = "reddit-post-scraping-tool"
version = "1.4.1.0" version = "1.5.0.0"
description = "Given a subreddit name and a keyword, RPST returns all top (by default) posts that contain the specified keyword." description = "Given a subreddit name and a keyword, RPST returns all top (by default) posts that contain the specified keyword."
readme = "README.md" readme = "README.md"
requires-python = ">=3.8" requires-python = ">=3.8"

View File

@@ -17,7 +17,7 @@ def run():
try: try:
# Check for updates # Check for updates
check_updates(version_tag="1.4.1.0") check_updates(version_tag="1.5.0.0")
# Get posts with the provided/parsed arguments # Get posts with the provided/parsed arguments
get_posts(arguments=arguments) get_posts(arguments=arguments)