From bcf2b083e77a4b9a6ac28bc4db184569fe4893b9 Mon Sep 17 00:00:00 2001 From: Denis Nutiu Date: Tue, 17 Dec 2024 16:28:57 +0200 Subject: [PATCH] initial commit --- .gitignore | 138 +++++++++++++++++++++++++++++++++++++ .idea/.gitignore | 8 +++ .idea/bluesky-bot.iml | 11 +++ .idea/modules.xml | 8 +++ .idea/vcs.xml | 6 ++ Cargo.toml | 7 ++ src/main.rs | 6 ++ src/scrapper.rs | 17 +++++ src/scrapper/gfourmedia.rs | 1 + 9 files changed, 202 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 .idea/bluesky-bot.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 Cargo.toml create mode 100644 src/main.rs create mode 100644 src/scrapper.rs create mode 100644 src/scrapper/gfourmedia.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f955719 --- /dev/null +++ b/.gitignore @@ -0,0 +1,138 @@ +# Created by https://www.toptal.com/developers/gitignore/api/rust,intellij,rust-analyzer +# Edit at https://www.toptal.com/developers/gitignore?templates=rust,intellij,rust-analyzer + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +# https://plugins.jetbrains.com/plugin/7973-sonarlint +.idea/**/sonarlint/ + +# SonarQube Plugin +# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin +.idea/**/sonarIssues.xml + +# Markdown Navigator plugin +# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced +.idea/**/markdown-navigator.xml +.idea/**/markdown-navigator-enh.xml +.idea/**/markdown-navigator/ + +# Cache file creation bug +# See https://youtrack.jetbrains.com/issue/JBR-2257 +.idea/$CACHE_FILE$ + +# CodeStream plugin +# https://plugins.jetbrains.com/plugin/12206-codestream +.idea/codestream.xml + +# Azure Toolkit for IntelliJ plugin +# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij +.idea/**/azureSettings.xml + +### Rust ### +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + +### rust-analyzer ### +# Can be generated by other build systems other than cargo (ex: bazelbuild/rust_rules) +rust-project.json + + +# End of https://www.toptal.com/developers/gitignore/api/rust,intellij,rust-analyzer diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/bluesky-bot.iml b/.idea/bluesky-bot.iml new file mode 100644 index 0000000..cf84ae4 --- /dev/null +++ b/.idea/bluesky-bot.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..c88b567 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..be98d4d --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "bluesky-bot" +version = "0.1.0" +edition = "2021" + +[dependencies] +env_logger = "0.11.5" diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..ec735b2 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,6 @@ +mod scrapper; + +fn main() { + env_logger::init(); + println!("Hello, world!"); +} diff --git a/src/scrapper.rs b/src/scrapper.rs new file mode 100644 index 0000000..22dd999 --- /dev/null +++ b/src/scrapper.rs @@ -0,0 +1,17 @@ +mod gfourmedia; + +/// NewsPost represents a news post. +pub struct NewsPost { + /// A URL containing the image of the post. + pub image: Option, + /// The title of the post. + pub title: String, + /// A summary of the post. + pub summary: Option, + /// The content of the post. + pub content: Option, + /// A link to the post. + pub link: String, + /// The author of the post. + pub author: String, +} diff --git a/src/scrapper/gfourmedia.rs b/src/scrapper/gfourmedia.rs new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/scrapper/gfourmedia.rs @@ -0,0 +1 @@ +