将文章直接插入 MediaWiki 数据库

发布于 2024-07-26 12:45:07 字数 137 浏览 2 评论 0原文

我需要一种方法可以将新文章直接插入我的 MediaWiki 数据库而不损坏 wiki 安装。

我猜如果我知道 MediaWiki 在创建新文章时插入哪些表/属性,那么我可以自己填写它们。

有谁知道更好的方法或有任何建议?

I need a way to insert new articles straight into my MediaWiki database without damaging the wiki installation.

I'm guessing if I knew what tables/attributes MediaWiki inserts to when creating a new article then I could fill them in myself.

Does anyone know a better way or have any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

放血 2024-08-02 12:45:07

我是批量页面创建器的作者,很高兴看到它仍在使用!

我最新的 MediaWiki 导入工具从 CSV 数据文件和页面模板创建页面。 它按照 Adrian 的建议生成 Mediawiki XML 导入文件。

查看

Mediawiki CSV 导入

I am the author of the Bulk Page Creator, nice to see it is still being used!!!

My latest MediaWiki Import tool creates pages from a CSV data file and page template. It generates Mediawiki XML Import files as suggested by Adrian.

Check it out

Mediawiki CSV Import

夏末染殇 2024-08-02 12:45:07

在 MediaWiki 可用的众多机器人和 API 中,一个简单的起点是 MediaWiki 批量页面创建者

它是一个简单的 PHP 脚本,依赖于 Snoopy 类库,可以从简单的文本格式创建多个页面。

在开始之前,请确保您先阅读创建机器人。 它包含有关如何设置机器人访问您的 wiki 的重要详细信息。

Out of many bots and APIs available for MediaWiki, a simple place to begin is the MediaWiki Bulk Page creator.

It is a simple PHP script, relying on the Snoopy class library, that can create several pages from a simple text format.

Before getting started, make sure you read Creating a Bot first. it contains critical details on how to set up bot access to your wiki.

病毒体 2024-08-02 12:45:07

您肯定不想直接写入数据库。 您可能想要创建一个扩展程序,将 RSS 中选定的项目作为输入,并使用 文章::doEdit()

Definitely you don't want to write to the database directly. You may want to create an extension that takes selected items from RSS as input and creates one wiki article per item, using Article::doEdit().

真心难拥有 2024-08-02 12:45:07

您应该使用机器人来完成此操作。 机器人可以独立运行,但如果您要与其他代码集成,您可能需要根据语言进行选择。 对于 PHP,有 MediaWiki 批量页面创建器。 对于 Python,pymediawiki 附带 Pagefromfile

还有 Yaron Koren 的扩展,名为 外部数据 解决相关任务。 它允许您将外部来源的数据合并到您的 wiki 页面中。 您可以从 CSV、XML 或 JSON 中提取特定元素——从 URL、本地文件或数据库检索。

You should do this with a bot. Bots can be run standalone, but if you're integrating with other code, you might want to pick based on the language. For PHP, there is the MediaWiki Bulk Page Creator. For Python, pymediawiki comes with Pagefromfile.

There is also an extension by Yaron Koren called External Data which solves a related task. It lets you incorporate data from external sources into your wiki pages. You can pull specific elements from CSV, XML or JSON -- retrieved from URLs, local files, or database.

你是我的挚爱i 2024-08-02 12:45:07

为什么需要这样做?

  • 如果您尝试从以前的 wiki 安装迁移数据,已经存在导入和导出工具。
  • 如果您想自动添加大量预先格式化的页面,MediaWiki API 提供了比直接修改数据库更安全的途径。

Why do you need to do this?

  • If you are trying to migrate data from a previous wiki installation, there exist import and export tools already.
  • If you want to automate the addition of a large set of pre-formatted pages automatedly, the MediaWiki API provides a safer route than mucking with the database directly.
寂寞笑我太脆弱 2024-08-02 12:45:07

使用 Special:Export

导出页面 使用 特殊:导入。 请注意,您必须拥有“导入”用户权限才能导入。

Export pages with Special:Export

Import pages using Special:Import. Note that you have to have the 'import' user right to be able to import.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文