Warning: fopen(/www/sites/update.greasyfork.icu/index/store/temp/17e3ded44373de478da4214fde70e39c.js): failed to open stream: No space left on device in /www/sites/update.greasyfork.icu/index/scriptControl.php on line 65
// ==UserScript==
// @name 新闻速递
// @namespace Violentmonkey Scripts
// @match *://*/*
// @grant GM_xmlhttpRequest
// @grant GM_openInTab
// @grant GM_registerMenuCommand
// @version 1.5
// @description Fetch news from API and open in a new tab with responsive design and translation.
// @run-at document-end
// @downloadURL https://update.greasyfork.icu/scripts/518571/%E6%96%B0%E9%97%BB%E9%80%9F%E9%80%92.user.js
// @updateURL https://update.greasyfork.icu/scripts/518571/%E6%96%B0%E9%97%BB%E9%80%9F%E9%80%92.meta.js
// ==/UserScript==
(function() {
'use strict';
const apiKey = 'dac6abc0634b4de08429b2580628dba8';
const apiUrl = `https://newsapi.org/v2/top-headlines?country=us&apiKey=${apiKey}`;
// Function to fetch and display news
function fetchAndDisplayNews() {
GM_xmlhttpRequest({
method: "GET",
url: apiUrl,
onload: function(response) {
if (response.status === 200) {
const data = JSON.parse(response.responseText);
if (data.articles && data.articles.length > 0) {
let newsContent = `
新闻列表