定时任务:用ChatGPT api 以关键词和特定描述,自动写原创文章,并自动发布
朋友需要做一个用wordpress的定时任务,来做这个定时器。功能是,用ChatGPT api 以关键词和特定描述,自动写原创文章,并自动发布。他说代码的关键在于,需要定时自动发布不会写?看看下面的代码,我利用wordpress自带的定时任务函数wp_schedule_event()搞定,当然,关于GPT api 的使用,我就不赘述了。
获得feed订阅内容 描述 Retrieves an external feed and parses it….
获得feed订阅内容
Retrieves an external feed and parses it. Uses the SimplePie and FeedCache functionality for retrieval and parsing and automatic caching.
<?php $feed = fetch_feed( $uri ); ?>
$uri
(mixed) (必填) The URI of the RSS feed you want to retrieve. If an array of URIs, the feeds are merged using SimplePie’s multifeed feature. The resulting feed is returned as a standard SimplePie object.
默认值: None
fetch_feed
caches results for 12 hours by default. You can modify this by modifying the time interval via the 过滤器 wp_feed_cache_transient_lifetime.
添加于 版本 Version 2.8
fetch_feed
is defined in wp-includes/feed.php
.
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。
评论功能已经关闭!