Skip to content

Instantly share code, notes, and snippets.

View Igouist's full-sized avatar
💬
Taz'Dingo!

Igou, The CRUD Machine Igouist

💬
Taz'Dingo!
View GitHub Profile
@Igouist
Igouist / Polyglot-Notebooks-Api-Example.cs
Created January 28, 2023 10:25
使用 Polyglot Notebooks 呼叫 Api 的範本,方便我之後回來左手抄右手用
#r "nuget:Microsoft.AspNetCore.WebUtilities"
using System.Net.Http;
using Microsoft.AspNetCore.WebUtilities;
using System.Text.Json;
using System.Threading.Tasks;
// 查詢台北公車
var api = $"https://ptx.transportdata.tw/MOTC/v2/Bus/EstimatedTimeOfArrival/City/Taipei/307";
var filter = $"stopId eq '15250'"; // 站牌代號
@Igouist
Igouist / AngleSharp_抓取股票資訊.linq
Last active June 4, 2022 15:12
使用 AngleSharp + Yahoo 股市來抓取目標股票的當日資訊
async Task Main()
{
var key = "2330";
var url = $"https://tw.stock.yahoo.com/quote/{key}";
var config = AngleSharp.Configuration.Default.WithDefaultLoader(
new LoaderOptions
{
IsResourceLoadingEnabled = true
});
<Query Kind="Program">
<NuGetReference>AutoMapper</NuGetReference>
<Namespace>AutoMapper</Namespace>
</Query>
void Main()
{
Sut().Dump();
}
[{
"date": "2021-11-01",
"income": 40000,
"expense": 7270,
"surplus": 32730
}, {
"date": "2021-12-01",
"income": 42253,
"expense": 12940,
"surplus": 29313
[{"date":"2010-01-01","assets":1000000},{"date":"2010-02-01","assets":1005071},{"date":"2010-03-01","assets":971782},{"date":"2010-04-01","assets":951410},{"date":"2010-05-01","assets":921696},{"date":"2010-06-01","assets":935989},{"date":"2010-07-01","assets":955785},{"date":"2010-08-01","assets":963051},{"date":"2010-09-01","assets":957508},{"date":"2010-10-01","assets":966978},{"date":"2010-11-01","assets":954005},{"date":"2010-12-01","assets":930165},{"date":"2011-01-01","assets":930158},{"date":"2011-02-01","assets":912424},{"date":"2011-03-01","assets":937339},{"date":"2011-04-01","assets":965512},{"date":"2011-05-01","assets":944426},{"date":"2011-06-01","assets":912848},{"date":"2011-07-01","assets":896753},{"date":"2011-08-01","assets":871802},{"date":"2011-09-01","assets":838515},{"date":"2011-10-01","assets":877834},{"date":"2011-11-01","assets":868697},{"date":"2011-12-01","assets":858742},{"date":"2012-01-01","assets":827313},{"date":"2012-02-01","assets":810711},{"date":"2012-03-01","assets":840
@Igouist
Igouist / PttMessageCrawler.linq
Created June 15, 2021 04:05
稽查目標 PTT 用戶的留言,使用 AngleSharp + pttweb
async Task Main()
{
var pttUser = "";
var page = 1;
var crawlar = new PttMessageCrawler();
var result = await crawlar.GetMessages(pttUser, page);
result.Dump();
}
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->