Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/icons/openai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions server/glob.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ declare module 'glob:./sources/{*.ts,**/index.ts}' {
export const linuxdo: typeof import('./sources/linuxdo')
export const mktnews: typeof import('./sources/mktnews')
export const nowcoder: typeof import('./sources/nowcoder')
export const openai: typeof import('./sources/openai')
export const pcbeta: typeof import('./sources/pcbeta')
export const producthunt: typeof import('./sources/producthunt')
export const qqvideo: typeof import('./sources/qqvideo')
Expand Down
21 changes: 21 additions & 0 deletions server/sources/openai.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { NewsItem } from "@shared/types"

export default defineSource(async () => {
const rss = await rss2json("https://openai.com/blog/rss.xml")
if (!rss) return []

const news: NewsItem[] = []
for (const item of rss.items) {
news.push({
id: item.id,
title: item.title,
url: item.link,
extra: {
date: item.created,
hover: item.description,
},
})
}

return news
})
1 change: 1 addition & 0 deletions shared/pinyin.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"fastbull-news": "fabucaijing-toutiao",
"solidot": "Solidot",
"hackernews": "Hacker News",
"openai": "OpenAI",
"producthunt": "Product Hunt",
"github-trending-today": "Github-Today",
"bilibili-hot-search": "bilibili-resou",
Expand Down
8 changes: 8 additions & 0 deletions shared/pre-sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ export const originSources = {
type: "hottest",
home: "https://news.ycombinator.com/",
},
"openai": {
name: "OpenAI",
color: "green",
column: "tech",
type: "realtime",
interval: Time.Common,
home: "https://openai.com/",
},
"producthunt": {
name: "Product Hunt",
color: "red",
Expand Down
8 changes: 8 additions & 0 deletions shared/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,14 @@
"color": "orange",
"interval": 600000
},
"openai": {
"name": "OpenAI",
"type": "realtime",
"column": "tech",
"home": "https://openai.com/",
"color": "green",
"interval": 1800000
},
"producthunt": {
"name": "Product Hunt",
"type": "hottest",
Expand Down
8 changes: 8 additions & 0 deletions wrangler.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name = "newsnow"
pages_build_output_dir = "dist/output/public"
compatibility_date = "2024-10-03"

[[d1_databases]]
binding = "NEWSNOW_DB"
database_name = "newsnow-db"
database_id = ""