Share
Embed
Transcript
20 slides
-
2024年 Rust Webアプリ開発の現在 billyio 2024年 6月 25日 2024年 Rust Webアプリ開発の現在
データサイエンスやデータエンジニアリングの 求人サイトの個人開発 by billyio 1/20 -
1. 自己紹介 2. 求人サイトの紹介 3. Rust開発 3.1 求人情報のスクレイピング 3.2 web開発
3.3 ブログ 2024年 Rust Webアプリ開発の現在 目次 by billyio 2/20 -
経歴: 2019年 3月 学士(商学) → IT派遣会社(現職) 2019年 11月 ~2022年 7月
画像処理、 CFDシミュレーション 2022年 8月 ~2024年 4月 データエンジニア 普段やっていること: ボルダリング , 育児 , 猫の世話 EURO2024 求人サイトの個人開発 atcoder鉄則 2024年 Rust Webアプリ開発の現在 自己紹介 ① by billyio 3/20 -
技術熟練度 Rustを使い始めて 100~150時間くらい web開発の業務経験なし 社内外のイベント登壇や LT経験なし Rust本や学習サイトはまだ(やりたい) 先月 atcoderを Rustで始めた。茶色レベル
web開発 , Rust, プレゼン , 資料のご意見やアドバイスあれば嬉しいです 2024年 Rust Webアプリ開発の現在 自己紹介 ② by billyio 4/20 -
データサイエンス、データエンジニアリ ングに関する求人情報を掲載。 https://data-career-blueprint.com/ 職種 : ML Engineer LLM Engineer Data
Scientist Data Analyst Data Engineer etc 2024年 Rust Webアプリ開発の現在 求人サイトの紹介 by billyio 5/20 -
目指すところ データサイエンスやデータエンジニアリングで一番使われる求人サイト 今後の開発 求人数を増やす(現在 340) Cloudflare D1, Workersを用いた開発 検索機能改善 2024年
Rust Webアプリ開発の現在 求人サイトの紹介 by billyio 6/20 -
.github/workflows/ publish.yml datacollector/ <--- 求人サイトのスクレイピングやデータ処理 src/main.rs Cargo.toml db/ <-- (開発中)
docs/ <-- ドキュメント群 handbook/ presentation/ biz/ images/ webapp/ <-- Webサービス開発 dist/ src/ pages/ main.rs Cargo.toml index.html styles.css 2024年 Rust Webアプリ開発の現在 デェレクトリ構成 by billyio 8/20 -
処理一覧 1. Notionの APIを使って 募集職種一覧 URL を取得 2. 各 URLを使って求人情報を取得
3. jsonで保存 2024年 Rust Webアプリ開発の現在 Rustを使ったスクレイピング by billyio 9/20 -
使用ライブラリ : scraper, serde, serde_json, reqwest use scraper::{Html, Selector}; let
html = r#" <ul> <li>Foo</li> <li>Bar</li> </ul> "#; let fragment = Html::parse_fragment(html); let selector = Selector::parse("li").unwrap(); for element in fragment.select(&selector) { assert_eq!("li", element.value().name()); } 2024年 Rust Webアプリ開発の現在 Rustを使ったスクレイピング by billyio 10/20 -
会社情報のデータベースを Notionで管理 主な項目: 法人番号 (13桁の数字 ) 主キー 商号又は名称 資金調達フェーズ (シリーズ
A~E,上場区分 ,子会社 /関連会社 ) 業種 募集職種一覧 URL 2024年 Rust Webアプリ開発の現在 Rustを使ったスクレイピング by billyio 11/20 -
Notion APIの制限 1クエリあたり最大 100件まで取得可 現状会社データベース 230件なので 10回のループで API制限回避可能 fn get_corp_db_from_notion()
-> Result<(), reqwest::Error> { // let mut headers = 省略 let client = reqwest::blocking::Client::builder().default_headers(headers).build()?; let url = "https://api.notion.com/v1/databases/XXXXX/query"; let mut combined_res_json: Vec<Value> = Vec::new(); for i in 1..=9 { <--- クエリ件数上限を回避 let body = json!({ "filter": { "property": "法人番号", "rich_text": { "starts_with": i.to_string() } } }); // 省略 } 2024年 Rust Webアプリ開発の現在 Rustを使ったスクレイピング by billyio 12/20 -
求人情報の職種名から規定のキーワードを含めばタグを追加。 let mut job_category = Vec::new(); let ml_engineer_keywords = ["機械学習エンジニア",
"MLエンジニア", "ML エンジニア", "AIエンジニア", "AI エンジニア", "Machine Learning Engineer"]; if ml_engineer_keywords.iter().any(|&keyword| job_title.contains(keyword)) { job_category.push("ml_engineer".to_string()); } 例えば、 「 AIエンジニア(自然言語処理) 」だと ["ml_engineer", "nlp_engineer"] 2024年 Rust Webアプリ開発の現在 Rustを使ったスクレイピング by billyio 13/20 -
3. jsonで保存 struct Record { corp_id: String, corp_name: String, corp_funding_stage:
String, corp_industry: Vec<String>, job_id: String, job_name: String, job_category: Vec<String>, job_url: String, content: String, } 2024年 Rust Webアプリ開発の現在 Rustを使ったスクレイピング by billyio 14/20 -
技術スタック Frontend: yew Backend: None Database/Data Source: json, (Cloudflare D1)
Hosting: Cloudflare Pages CI/CD: GitHub Actions 2024年 Rust Webアプリ開発の現在 Rustを使った webサイト by billyio 15/20 -
現状、フロントエンドで JSONデータ (1.2MB)を保持 let data: &str = include_str!("./data/file.json"); let all_jobs:
Vec<Record> = serde_json::from_str(data).unwrap(); 2024年 Rust Webアプリ開発の現在 Rustを使った webサイト by billyio 16/20 -
use pulldown_cmark::{Parser, Options, html::push_html}; use web_sys::HtmlElement; #[function_component(Blog)] pub fn blog()
-> Html { let markdown_input = include_str!("../../../docs/handbook/main.md"); let mut options = Options::empty(); options.insert(Options::ENABLE_TABLES); let parser = Parser::new_ext(markdown_input, options); let mut html_output = String::new(); push_html(&mut html_output, parser); html! { <div> <HtmlContent html_content={html_output.clone()} /> </div> } } 2024年 Rust Webアプリ開発の現在 Rustを使ったブログ開発 by billyio 18/20 -
そもそもブログの数が少ない (ない )のでハードコーディング let markdown_input = include_str!("../../../docs/handbook/main.md"); include_str! は、 Rustの
macroで、指定したファイルの内容をコンパイル時に文字列リテラル let file_path = "path/to/your/file.txt"; let file_content = include_str!(file_path); // コンパイルエラーになる 2024年 Rust Webアプリ開発の現在 Rustを使ったブログ開発 by billyio 19/20 -
https://data-career-blueprint.com/ Rust https://github.com/yewstack/yew https://github.com/causal-agent/scraper https://github.com/pulldown-cmark/pulldown-cmark Notion https://developers.notion.com/reference/post-database-query#errors Marpit https://marpit.marp.app/theme-css?id=customize-content 2024年
Rust Webアプリ開発の現在 参照 by billyio 20/20