はてなキーワード: tryとは
増田で 3 分以上投稿されない期間があるのか気になったから調べた
直近の 1 日だとこれだけあった
2025-03-22 00:14 -- 2025-03-22 00:18 2025-03-22 00:10 -- 2025-03-22 00:14 2025-03-21 07:56 -- 2025-03-21 08:00 2025-03-21 07:50 -- 2025-03-21 07:56 2025-03-21 07:44 -- 2025-03-21 07:48 2025-03-21 07:28 -- 2025-03-21 07:32 2025-03-21 06:58 -- 2025-03-21 07:03 2025-03-21 06:45 -- 2025-03-21 06:54 2025-03-21 06:32 -- 2025-03-21 06:37 2025-03-21 05:56 -- 2025-03-21 06:04 2025-03-21 05:51 -- 2025-03-21 05:56 2025-03-21 05:34 -- 2025-03-21 05:38 2025-03-21 05:30 -- 2025-03-21 05:34 2025-03-21 05:00 -- 2025-03-21 05:09 2025-03-21 04:56 -- 2025-03-21 05:00 2025-03-21 04:45 -- 2025-03-21 04:50 2025-03-21 04:09 -- 2025-03-21 04:13 2025-03-21 03:41 -- 2025-03-21 03:45 2025-03-21 03:29 -- 2025-03-21 03:39 2025-03-21 03:03 -- 2025-03-21 03:07 2025-03-21 02:56 -- 2025-03-21 03:02 2025-03-21 02:44 -- 2025-03-21 02:48 2025-03-21 02:33 -- 2025-03-21 02:37 2025-03-21 02:21 -- 2025-03-21 02:27 2025-03-21 02:14 -- 2025-03-21 02:19
秒はみてないから 00:01:01 - 00:03:59 はほぼ 3 分だけど 2 分扱いだし、 00:01:59 - 00:04:00 はほぼ 2 分だけど 3 分扱いになるくらいの誤差はある
日によって違うだろうし、曜日の影響も大きそうだから 1 ヶ月分くらい調査しようかと思ったけど、
増田の量が思いの外多すぎて 1 日分だけでも 100 ページ以上取得しないといけなかった
件数だと 2500 以上
一応取得に使ったコードも載せとく
import { setTimeout } from "node:timers/promises" import { Browser } from "happy-dom" const getTimestamps = async function* () { const browser = new Browser() const page = browser.newPage() try { for (let num = 1; ; num++) { await setTimeout(3000) await page.goto(`https://anond.hatelabo.jp/?page=${num}`) const days = page.mainFrame.document.querySelectorAll(".day") for (const day of days) { const date = day.querySelector("h2 .date").textContent.trim() for (const footer of day.querySelectorAll(".sectionfooter")) { const time = footer.textContent.match(/\d{2}:\d{2}/)[0] yield `${date} ${time}` } } } } finally { await page.close() await browser.close() } } const diff = (a, b) => { return new Date(b + ":00") - new Date(a + ":00") } let prev = null for await (const datetime of getTimestamps()) { if (prev && diff(datetime, prev) > 1000 * 60 * 3) { console.log(datetime, prev) } prev = datetime }
基本は空いても 5 分程度であり、最大でも 10 分となっている
「フロントエンド不要論」は、最近の開発現場やサーバーレス、クラウド技術の進化に関わっている人たちの間でリアルに実感されている問題です。
• React, Vue, Angular などのフレームワークがどんどん複雑化
• フロントエンドとバックエンドの分離が、**「本当に効率的か?」**という疑問が生じている
• 「最終的にHTMLを描画するだけなら、サーバーでやればよくない?」
• フロントエンドから直接APIを叩く構成では、「APIを守る」ことが難しい
• XSS, CSRF, CORSといった脆弱性に対処し続けるコストが無駄
🚩 3. サーバーレス・クラウド技術が進化し、APIの負担を減らす方向に
• AWS Lambda, API Gateway, Cognitoなどのサーバーレス技術が進化
• フロントエンドがAPIを叩くより、サーバー側で直接処理する方が効率的
• 以前はReactを使用 → ReactをやめてHTMLベースに戻した
• React, Vue, Angularを全廃
• JavaScriptなしで動的なページを実現
3. Laravel(Livewire)
4. Shopify(GraphQLでデータを直接取得)
• フロントエンドを完全分離する構成から、「バックエンドがHTMLを返せばいい」 というシンプルな構成へ移行
• APIの負担を減らすことで、開発効率とセキュリティを向上
✅ サーバーレス時代の最適解:「フロントエンド不要アーキテクチャ」
「フロントエンドを捨てて、サーバーがすべての処理を担う」方向に移行するのが最適解になりつつある。
📌 最適なアーキテクチャ
ブラウザ → サーバー(PHP, Node.js, Go) → API Gateway(Cognito認証)
📌 具体的な実装例(PHP + Cognito + API Gateway)
require 'vendor/autoload.php';
use Aws\CognitoIdentityProvider\CognitoIdentityProviderClient;
use Aws\Exception\AwsException;
$client = new CognitoIdentityProviderClient([
'credentials' => [
'key' => getenv('AWS_ACCESS_KEY_ID'),
'secret' => getenv('AWS_SECRET_ACCESS_KEY'),
],
]);
$email = $_POST['email'];
$password = $_POST['password'];
try {
$result = $client->initiateAuth([
'AuthFlow' => 'USER_PASSWORD_AUTH',
'ClientId' => 'XXXXXXXXXX',
'USERNAME' => $email,
],
]);
setcookie("accessToken", $result['AuthenticationResult']['AccessToken'], [
'samesite' => 'Strict'
]);
header("Location: dashboard.php");
}
?>
🚀 **「フロントエンドはもう不要」**という流れは、最新のクラウド/サーバーレス開発に携わる人たちが実感していること。
☑ セキュリティが大幅に向上する
プログラマー歴15年くらい
tryとかchatchとか、エラーをキャッチするとか、エラーをハンドリングするとか
相当長い期間苦手意識があった
でも今はようやっと慣れてるのに気づいた
長くやるもんだな
何で苦手なんだろう
発生したエラーがどこで処理されるか・どこで処理するか分からんからかな
cahtchしてみたはいいがこのエラーどうすんのみたいな、そうか複数人開発におけるエラーハンドリングがコミュニケーション量過多だからかな
ほんとは最初にエラー方針決めとけば良いんだけど、最後にやりがちなんだよな
もちろん開発レイヤーによるだろうけど
てか複数人開発でのエラーのthrowって丸投げ感あるよな、誰かやるだろうみたいな、あるいは丸投げにならないように慎重にやるとほかもやる必要が出てやぶ蛇とか
リードがしっかりしてれば良いんだけど
衣服を重ね着してください。まずは吸湿発散性のベースレイヤーを着て、次にフリースやダウンジャケットなどの断熱性のある中間レイヤーを重ね、最後に防水性と防風性のあるアウターレイヤーを重ねます。
手足も忘れずに。断熱手袋、暖かい帽子、スカーフやネックゲートルを着用してください。足を暖かくドライに保つには、保温性のある靴下と防水ブーツが欠かせません。
Consider investing in heated clothing, such as heated gloves, vests, or insoles. They can provide extra warmth during frigid commutes.
Keep disposable or rechargeable hand warmers in your pockets. They’re great for providing instant warmth when needed.
お茶、コーヒー、ホットチョコレートなどの温かい飲み物を入れた魔法瓶を持ち歩きましょう。温かい飲み物を飲むと体温を維持するのに役立ちます。
Moisture can quickly make you feel cold. Make sure your outer layers are waterproof to keep snow and rain out. If you do get wet, change into dry clothes as soon as possible.
Use a windproof jacket and accessories like a balaclava or face mask to shield yourself from biting winds.
If you’re standing or waiting for transportation, try to move around periodically to keep your blood circulating and stay warm.
Portable heat packs can be tucked into pockets or clothing to provide additional warmth.
断熱性と防水性に優れたブーツを履きましょう。インソールを追加することで、足を暖かく保つこともできます。
これらの戦略は、最も寒い冬の日でも暖かく快適に過ごすのに役立ちます。暖かく安全に過ごしましょう!❄️ 他にご質問がある場合や、さらにヒントが必要な場合は、お気軽にお問い合わせください。
はてぶで一年前にまとめてずっと下書きだった内容。これ名前出して書いたら揉めそうだと思ったのでずっと投稿してなかったが、増田で供養。
”スコットランド政府は、そのセーフアクセスゾーンと称する範囲に家があ
る市⺠たちに⼿紙を送りつけて、⾃宅内の詩的なお祈りですら、この法律違反になりかねな
いぞと警告したんです。当然ながら、政府はその読者に対し、イギリスやヨーロッパでこの
思考犯罪を犯した疑いのある同胞たちを通報するよう奨励したんです。” 原文:This last October, just a few months ago, the Scottish government began distributing letters to citizens whose houses lay within so-called safe access zones, warning them that even private prayer within their own homes may amount to breaking the law. Naturally, the government urged readers to report any fellow citizens suspected guilty of thought crime in Britain and across Europe.
2024年9月、スコットランド政府は「Abortion Services (Safe Access Zones) (Scotland) Act 2024」を施行し、すべての中絶サービス提供施設の周囲200メートル以内を「安全アクセスゾーン」と定めました。このゾーン内では、女性やスタッフの意思決定に影響を与えたり、アクセスを妨げたり、恐怖や嫌がらせ、不安を引き起こす行為が犯罪とされています。
ttps://www.gov.scot/news/safe-access-zones/ 政府公式ページ
”ニュース
スコットランドのすべての中絶サービスの周りの200メートルの保護ゾーンが設置されました。
これらのゾーン内では、サービスにアクセスするための女性とスタッフの決定に影響を与える可能性のある方法で意図的または無謀に行動することは、今や刑事犯罪です。彼らのアクセスを妨げる;そうでなければ、警報、嫌がらせ、または苦痛を引き起こします。
スコットランド警察は法律を施行する責任があります。法律を破った人は、裁判所の手続きに応じて、£10,000までの罰金を科されるか、無制限の罰金が科せられます。
犯罪が犯されたかどうかを判断することは、スコットランド警察、クラウンオフィス、検察庁、裁判所の問題になります。各ケースの事実と状況に応じて、犯罪行為のいくつかの例には、中絶サービスにアクセスしないように誰かに説得し、クリニックや病院に出入りしようとする人々を取り囲み、チラシを配ることが含まれます。、宗教的な説教と沈黙の徹夜。原文;approaching someone to try and persuade them not to access abortion services, surrounding people as they try to go in or out of the clinic or hospital, handing out leaflets, religious preaching and silent vigils.
“セーフアクセスゾーンの導入は、女性の中絶権を保護する上で重要なマイルストーンです–誰も女性の個人的な医療決定に干渉する権利がなく、法律により、そのことが十分に明らかになっています。
“ジリアン・マッカイと、この法律を進展させるための彼らの仕事に関係したすべての人々に感謝します。私は特に、法案のプロセス中に発言し、経験を共有することに信じられないほどの勇気を示した女性を認識したいと思います。
“すべての中絶サービスの周りの200メートルの新しいゾーンは、女性が脅迫を受けずにヘルスケアに安全にアクセスできるようにするのに役立ちます–。この法律は、多くの人が深く個人的で困難な決定を下すことに信じられないほど脆弱であると感じるときに、女性を保護することです。”
ーーーーーーーーーーーーーーーーーーーーーーーーーーーー
特に、政府が配布したガイダンスでは、「意図的または無謀に」行われる「宗教的説教」や「静かな集会(silent vigils)」などの活動が禁止される可能性があると明記されています。さらに、エディンバラの「安全アクセスゾーン」内の住民に送付された手紙では、自宅内での行為であっても、法律に抵触する可能性があると警告されています。
https://www.gbnews.com/news/praying-at-home-illegal-scottland-safe-access-zones-abortion-law
”スコットランドの新しい「安全なアクセスゾーン」中絶法では、自宅での祈りは違法である可能性 公開日:2024年10月10日 -”
”エディンバラの「安全なアクセスゾーン」の居住者に投稿された手紙は、彼らが自宅で実行された訴訟のために刑事訴追に直面する可能性があると警告したとテレグラフは報じている。”
この法律の施行により、特定の地域内での祈りや宗教的活動が制限されることとなり、住民や宗教団体から懸念の声が上がっています。一方で、政府はこの措置が中絶サービスを利用する女性やスタッフの安全とプライバシーを守るためのものであると説明しています。
ttps://www.gbnews.com/news/abortion-clinics-silent-prayer-safe-zones-banned-home-office
”内務省は、中絶反対運動家が静かに診療所外で祈ることを禁止することを検討していると述べました。”
”沈黙の祈りは、心の関与であり、神への祈りの中で考えられており、1998年の人権法の下で絶対的な権利として保護されており、それ自体では、いかなる状況でも犯罪と見なされるべきではありません。”
いちおう揺り戻しも来ている模様
ttps://www.gbnews.com/news/video-silent-prayer-demonstrator-claims-police-turn-blind-eye-attacks-pro-lifers
“クレイジーなことは、私(2回逮捕された)が静かに路上で祈っているとき、通りにも止まっている他の人々がいるということです。誰かがタバコを持っているかもしれません、誰かが友人を待っているか、タクシーを待っているかもしれません。
“警察はこれらの人々のいずれにも近づかず、彼らに尋ねません、彼らは祈っていますか、彼らは何を考えていますか?
“しかし、地元の人々の何人かは私がプロライフであることを知っており、警察に連絡するので、警察は彼らをサポートし、地域の分裂の精神を強制するのを助けました。”
Let’s face it: starting a conversation on a dating app can feel terrifying. You see someone you’re interested in, you type out a message, and then… you delete it. “Is this too boring?” “Will they even respond?” “What if I sound awkward?”
We’ve all been there. That first message can make or break your chances of connecting with someone amazing. But here’s the good news: you don’t have to overthink it. With the right opening line, you can spark a conversation that feels natural, fun, and meaningful.
At MixerDates, we believe that every great connection starts with a great conversation. That’s why we’ve put together this guide to help you craft the best dating app opening lines—ones that stand out, show your personality, and lead to real connections. Ready to ditch the “hey” and start making an impact? Let’s dive in!
[:contents]
Before we get into the best opening lines, let’s talk about why your first message is so important.
Your opening line is your chance to make a great first impression. It’s the gateway to a conversation that could lead to something special. A thoughtful, creative message shows that you’re genuinely interested—not just swiping mindlessly.
Your first message sets the tone for the entire conversation. A boring or generic opener might lead to a dull chat, while a fun or intriguing one can spark excitement and curiosity.
Let’s be real: everyone loves feeling special. When you put effort into your opening line, it shows that you care enough to stand out. And on MixerDates, where we value authenticity and positivity, that effort goes a long way.
Now, let’s get to the good stuff—the best dating app opening lines that actually work. These are divided into categories to suit different personalities and situations.
While the examples above are great starting points, the best opening lines are the ones that feel authentic to you. Here are some tips to help you craft your own:
Reference something from their profile—a photo, a hobby, or a shared interest. It shows you’re paying attention and not just copying and pasting.
Avoid heavy or overly serious topics right off the bat. Keep the tone light and playful to make the conversation enjoyable.
Don’t try to be someone you’re not. If you’re naturally funny, lean into that. If you’re more thoughtful, go for a sincere compliment or question.
“Hey” or “What’s up?” might be easy, but they’re also forgettable. Put in a little effort to stand out.
This gives the other person an easy way to respond and keeps the conversation flowing.
At MixerDates, we’re all about creating a positive, inclusive space where you can feel comfortable being yourself. Here’s why our platform is the best place to put these opening lines into practice:
We welcome everyone, no matter who you are or who you love. Our platform is designed to be a safe space where you can connect with like-minded people.
Our users create detailed profiles that make it easy to find shared interests and craft personalized opening lines.
We encourage our community to be genuine and kind, so you can feel confident starting conversations without fear of judgment or rejection.
Don’t just take our word for it—here’s what one of our users had to say:
“I met my partner on MixerDates, and it all started with a simple message about our shared love for travel. The conversation flowed naturally, and the rest is history. I’m so grateful for this platform!”
While a great opening line can spark a conversation, building a real connection takes more than just a clever message. Here are the key elements to look for when seeking a meaningful connection:
A strong connection starts with alignment on the things that matter most. Do you share similar values, life goals, or visions for the future?
Look for someone who is willing to share their thoughts, feelings, and vulnerabilities—and who encourages you to do the same.
Healthy relationships are a two-way street. Both people should be putting in effort to communicate, plan dates, and support each other.
A true connection allows both people to be themselves without judgment. Look for someone who celebrates your uniqueness and encourages you to pursue your passions.
Communication is the foundation of any strong relationship. A mutual connection thrives on honesty, transparency, and the ability to resolve conflicts in a healthy way.
At MixerDates, we’re here to help you find these key elements in a partner. Our platform is designed to connect you with people who share your values and are looking for the same things you are. Starting a conversation on a dating app doesn’t have to be stressful. With the right opening line, you can spark a connection that feels natural, fun, and meaningful. And at MixerDates, we’re here to help you every step of the way.
So, what are you waiting for? Craft that perfect opening line, join MixerDates, and start connecting with people who value authenticity and positivity. Your perfect match is out there—and they’re just one message away.
2010年頃に社会人になって投資を始めた。きっかけは特にないけど、お金を増やすために何かしたいと思ったのが理由だと思う。
最初に手を出したのはFX。仕事終わりに家でEUR/JPYのロングを触ってたけど、ギリシャショックが直撃して大きくやられた。10万円くらいのマイナスだったけど、初めて眠れない夜を経験した。結局、耐えきれなくて仕事中に損切りしたけど、1週間後に相場が戻ってて「なんだこれ」という気持ちになった。
EURのおかげで自分のメンタルの限界を認識でき、長期目線に切り替えることができた。長期目線になってからは一時的な含み損では全く動じなくなった。
その後はスワップ狙いでAUD/JPYやTRY/JPYをロングしてた。
AUDは110円くらいのロングを掴んでしまい、しばらく塩漬けにしていたけど、最終的にはプラスで終了。
TRYはもうどうしようもない。触ったのが間違い。昨年全部損切りしてFXをやめた。
14年間でプラマイゼロ。利益をTRYがほぼ全部持っていった。
CFD取引にも手を出した。コロナの頃に原油やVIXを少し触ったけど、値動きのルールが全く理解できず、大怪我をする前に撤退。
2017年から国内株を始めた。配当金や株主優待目当てでいくつか買った。ネームバリューと配当利回りにひかれて7201を買ったけど、すぐに無配になって痛い目を見た。最近まで塩漬けにしてたけど、資本提携のニュースを機に売却。
国内個別株はトータルで確定損益は+50万円、含み益は+350万円くらい。
海外株も同じ頃に始めた。先輩がAMZNでアパートが買えるくらい儲けていると聞いて、すぐに海外証券口座を開設。AMZN、GOOG、ADBEを買った。
当事深層学習を少し触っていたこともあり、関連株のNVDAも少し買っていた。仮想通貨バブルのときに売らずにガチホした自分を褒めたい。
投資額が一番多いのはここ。NISA枠も全部投資信託で埋めてる。
最初はeMAXISのバランス型を買ったけど、面白くなくて先進国株やNASDAQ100、TECLみたいなリスク高めのものに切り替えた。
今のところ含み益は+1000万円くらい。
会社の退職金代わりで加入させられたやつ。外国株インデックス7割、国内インデックス3割くらいの配分。
トータルのプラスは正確にわからないけど、投資額はたぶん850万円くらいで、含み益は+1200万円くらい。
ちなみに、確定拠出年金の拠出額は就職先を選ぶときのわりと重要なポイントな気がしている。なかなか入社前に聞きにくいけどね。
年収が高くても拠出額が少ない会社は結構あるし、生涯年収で見ると大きな差になる。
投資信託やっとけ。
最近Geminiがすごく賢く、特にgemini-exp-1206というモデルは全LLMで最も高いスコアを獲得している。
https://lmarena.ai/?leaderboard
ChatGPTの今月分の課金が終わりそうだったので、今度はGeminiに移るかと思って遊んでたんだけど、・・・正直使い物にならない。
政治関連のトピックを含むと途端にこういうメッセージが出て回答が得られないのだ。
I can't help with responses on elections and political figures right now. While I would never deliberately share something that's inaccurate, I can make mistakes. So, while I work on improving, you can try Google Search.
いや、政治と言ってもロイターのこの記事 ↓ を翻訳してと言っただけなんだけど。
これもうダメだ。
Gemini AI Studioでも同様のことが起きるが、セーフフィルターのCivic Integrityを無効にするとちゃんと回答してくれる。
でもGemini AI Studioは所詮お試しのプレイグラウンド。履歴機能も何も無い。
The request could not be satisfied.
We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
Generated by cloudfront (CloudFront) HTTP3 Server
Request ID: gpTV5kJbc7xesPlmWxthzeKZ6L9GlhdcTEstGmHhLQc1hfRD8pPXBA==
盛り上がるぜ!!
ビューネイくたばれ!
なんだこれ!猛烈に!猛烈に盛り上がるう!!
グランドリオンで岩をぶったぎったあああ!!
ストーリーのクライマックス!あぁもうすぐこの戦いも終わるんだって勢いがすごい!
うおおおおおお!俺こそまさに世界最強のモンスターハンターだあああああああああ
難ステージを超えた先に爽やかな曲!
Britannica Dictionary definition of MOTHER COUNTRY
[count]
1
: the country where people who live in a colony or former colony came from — usually singular — usually used with the
The colonies rebelled against the mother country.
Definitions from Oxford Languages · Learn more
/ˈməT͟Hər ˌkəntrē/
noun
noun: mother country; plural noun: mother countries
a country in relation to its colonies.
そもそも"Mother Country" って現在の英語で滅多にいわないのよ
The smell of paint and buzzing of bees. I was made to paint the fence as punishment. By me is Ben, the neighbor boy.
"Having fun?" he asks, mocking. I won't let him make fun of me!
"I could do this all day!" I replied. And guess what? Ben begged for the brush to try it, offering an apple in return. Other kids lined up, too. offering me their valuables. Now that's adventure!
The fence was painted, and adventure awaited! But then, I spotted an angel! In an instant, Amy left my heart, making room for this girl. Naturally, I flipped, jumped, and showed off, just win her admiration. At first, she paid me no mind, but then she threw a flower at me.
"It's a sign!" I thought to myself. I sat on the fence and waited until evening, hoping to see her again.
AIインフルエンサーたちはChatGPTが世に出る前は何を投稿していたのか?(1/1)の続き
このTwitterアカウントは、主にYouTube、SEO、競馬、アニメなどの話題について呟いており、自身の活動や興味関心について発信しています。
このアカウントは、日々の米国株や暗号通貨の市場動向、特にテクノロジー関連株やビットコインの価格変動についてツイートしています。
「ゼロコロナ政策再び。 $AAPL の生産に影響が懸念され大きく下落。更に経済混乱が想定され、株価はSP500全業種で
一方で年末商戦売上堅調な滑り出しで $AMZN
暗号資産レンディングBlockFiが経営破綻、暗号通貨も軒並み下落。
チャート上、なんとか踏み止まるか? 」
このアカウントは、AI、特にプロマネAIや量子AIに関する話題や、仕事効率化、プログラミング、そして最新の技術トレンドについて呟いています。
"プロマネAIの実証実験を開始しました!量子AI×NotionによるプロマネAIの実証実験を開始 https://prtimes.jp/main/html/rd/p/000000003.000082094.html… via @PRTIMES_JP"
このアカウントは、主にOpenAIの最新言語モデル「text-davinci-003」の進化と、そのモデルを用いた英語学習ツールやサービスについて呟いています。特に、英語学習におけるAI活用とその重要性を強調しています。
"朝起きたら世界がまた変わっていた(笑)。@OpenAI が最新モデル「text-davinci-003」を発表。主な特徴は、①より明確で、説得力のある文章が書ける②より複雑な指示にも対応③より長い形式のコンテンツが生成可 1月に"InstructGPT"が出た時も感動したけどそれを遥かに上回る進化、です。"
このアカウントは、主にAI、特に画像生成AIに関する話題を呟いています。特にStable Diffusionのバージョンアップや使い方について多くのツイートをしています。
ここにリストアップした人たち以外もみましたが、分類すると3種類のアカウントがいて
またIDを変更してログがヒットしない人は含まれていません(IDから特定できるけどそこまでやらなかった)
javascript:(function() {
const text = Array.from(document.querySelectorAll('[data-testid="tweetText"]')).map(s => s.textContent.trim()).join('\n');
const textarea = document.createElement('textarea');
document.body.appendChild(textarea);
try {
document.execCommand('copy');
console.log('結果がクリップボードにコピーされました!');
} catch (err) {
console.error('クリップボードへのコピーに失敗しました:', err);
}
document.body.removeChild(textarea);
})();
const axios = require('axios'); // HTTPリクエストを行うためのモジュール
const fs = require('fs'); // ファイル操作モジュール
const xml2js = require('xml2js'); // XMLをJSONに変換するためのモジュール
const chardet = require('chardet'); // 文字エンコーディングを検出するためのモジュール
const iconv = require('iconv-lite'); // 文字エンコーディングを変換するためのモジュール
const rssUrl = 'https://www.mlit.go.jp/important.rdf'; // 例としてRSSフィードのURLを指定
async function fetchAndSaveRSS() {
try {
// RSSを取得
const response = await axios.get(rssUrl, { responseType: 'arraybuffer' });
const rssData = response.data;
const detectedEncoding = chardet.detect(rssData);
console.log('検出された文字エンコーディング:', detectedEncoding);
// UTF-8に変換
const utf8Data = iconv.decode(rssData, detectedEncoding);
xml2js.parseString(utf8Data, (err, result) => {
if (err) {
console.error('XML解析エラー:', err);
return;
}
const jsonData = JSON.stringify(result, null, 2);
fs.writeFileSync('rss_feed.json', jsonData, 'utf8');
console.log('RSSフィードがファイルに保存されました。');
});
console.error('エラーが発生しました:', error);
}
}
// 実行
fetchAndSaveRSS();