全自动小说订阅微信推送
<?php header("Content-type: text/html;charset=utf-8"); //set_time_limit(0); $dbname = SAE_MYSQL_DB; $host = SAE_MYSQL_HOST_M; $port = SAE_MYSQL_PORT; $user = SAE_MYSQL_USER; $pwd = SAE_MYSQL_PASS; $connect = @mysql_connect("{$host}:{$port}",$user,$pwd,true); if(!$connect) { die("Connect Server Failed:". mysql_error()); } if(!mysql_select_db($dbname,$connect)) { die("Select Database Failed:". mysql_error($connect)); } mysql_query("set names 'utf8'"); $rules = array( 'start'=>'http://www.douluodalu.com.cn/jueshitangmen/6860.html',//开始采集的url 'title'=>'/<h1>(.*?)</h1>/',//文章title 'time'=>'/发布时间:(.*?) /',//发布时间 'content'=>'/"></div><p>([sS]*?)<div align=center>/',//内容 'next'=>'/下一篇: <a href="(.*?)"/',//下一篇网址 ); //每次排序,取出上一次的最后一篇url $url = getLatest(); //最后一章的下一篇为空,由此循环 while($url != null && $url !=""){ $value = get($url); $value = _prefilter($value);//去除空白字符,空格,回车 $context = getContent($value); $context['url'] = $url;//当前url,同时还有下一篇的url $url = $context['next']; var_dump($url); //防止重复 if(storage($context)){ storageWP($context); }; } echo"采集结束"; mysql_close($connect); function storage($content_array){ global $connect; $sql ="insert into `articles` (`id`, `title`, `time`, `url`, `content`) values(null, '{$content_array['title']}', '{$content_array['time']}', '{$content_array['url']}', '{$content_array['content']}');"; $result = mysql_query($sql,$connect); return $result; } function storageWP($content_array){ global $connect; $result = mysql_query("select max(ID) from wp_posts;",$connect); $row = mysql_fetch_row($result); $last_id = $row[0] +1 ; $sql ="INSERT INTO `wp_posts` (`ID`, `post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_title`, `post_excerpt`, `post_status`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_content_filtered`, `post_parent`, `guid`, `menu_order`, `post_type`, `post_mime_type`, `comment_count`) VALUES (null,1,'{$content_array['time']}', '{$content_array['time']}', '{$content_array['content']}', '{$content_array['title']}', '', 'publish', 'open', 'open', '', '{$content_array['title']}', '', '', '{$content_array['time']}', '{$content_array['time']}', '', 0, 'http://iniu.sinaapp.com/?p={$last_id}', 0, 'post', '', 0);"; $result = mysql_query($sql,$connect); $sql ="INSERT INTO `wp_term_relationships` (`object_id`, `term_taxonomy_id`, `term_order`) VALUES({$last_id}, 1, 0);"; $result = mysql_query($sql,$connect); return $result; } function getContent($value){ global $rules; preg_match($rules['title'],$value, $title); preg_match($rules['time'],$value, $time); preg_match($rules['next'],$value, $next); preg_match($rules['content'],$value, $content); $context = array( 'title' => addslashes($title[1]), 'time' => $time[1], 'next' => addslashes($next[1]), 'content' => addslashes($content[1]) ); return $context; } function getLatest(){ global $connect; global $rules; $sql ="SELECT url FROM `articles` ORDER BY id DESC LIMIT 1"; $result = mysql_query($sql,$connect); $row=mysql_fetch_row($result); if($row){ return $row[0]; }else{ return $rules['start']; } } function get($url){ $ch = curl_init($url) ; curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) ; curl_setopt($ch, CURLOPT_BINARYTRANSFER, true) ; $value = curl_exec($ch) ; curl_close($ch); return $value; } function _prefilter($output) { strip_tags($output); $output=preg_replace("///[Sftv ]*?;[r|n]/","", $output); $output=preg_replace("/<!--[sS]*?-->/","", $output); $output=preg_replace("/>[s]+</","><", $output); $output=preg_replace("/;[s]+/",";", $output); $output=preg_replace("/[s]+}/","}", $output); $output=preg_replace("/}[s]+/","}", $output); $output=preg_replace("/{[s]+/","{", $output); $output=preg_replace("/([s]){2,}/","$1", $output); $output=preg_replace("/[s]+=[s]+/","=", $output); $output=preg_replace("/<br />/","",$output); $output=preg_replace("/n/","",$output); $output=preg_replace("/ /","",$output); return $output; } ?>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



In the digital age, new media platforms have become an important place for content creation and sharing. Kuaishou, as the leading short video platform in China, has also attracted a large number of users to publish their own original novels and earn revenue in this way. So, how do you make money by publishing novels on Kuaishou? This article will analyze in detail the mechanism by which Kuaishou earns money from publishing novels, and explore how to create attractive novel tweets. 1. How does Kuaishou make money by publishing novels? The main ways to make money by publishing novels on Kuaishou are as follows: Based on the playback volume of the novel on the Kuaishou platform and user interaction, the author will receive corresponding advertising shares. The higher the playback volume of a novel, the more revenue the author can earn. 2. Gift rewards: Kuaishou users can send virtual gifts to authors through

This article will explore the “Subscription expired, renew payment to retain Microsoft 365” notification that appears on Windows 11/10 computers. This is not an error message, but an alert you see in Notification Center. According to reports, some users are still receiving this notification despite having an active subscription. If you encounter a similar situation, you can refer to the suggestions provided in this article. Your subscription has expired, please renew your payment to retain Microsoft 365. If you receive a notification that your subscription has expired, it is recommended not to click on the links or take action immediately. Please make sure to verify the authenticity of the notification through official channels before updating your payment to avoid potential infection risks to your system. Check your subscription status Check your payment information Use good anti-malware or anti-malware software

The country or region of your Apple ID cannot be changed. In many cases, you cannot change the region of your Apple ID. We have discussed all these conditions and their respective solutions so that you can change AppleID on iPhone. Fix 1 – Cancel all active subscriptions Apple does not allow you to perform region modification operations if you already have active subscriptions. Typically, these apps have different subscription plans, tiers, and fees (currencies) in different regions. Step 1 – You have to go to Settings. Step 2 – You will find your Apple ID at the top of the Settings page. Step 3 – Click once to open it. Step 4 – On the next page, open the Subscriptions menu. Step 5 – You can view it in

1. How to read novels on Zhihu? Share how to read novels on Zhihu! 1. Search for novels: Open the Zhihu app, enter novels in the search bar, and search to get many novel resources of different themes. 2. Read novels in the Salt Selection channel for members: In the bottom bar of the homepage interface, click on members, and you can see the Salt Selection column, which contains a large number of novels. 3. Recommended novels on the homepage: If you read too many novels, the software will automatically recommend novels that you are interested in. If you browse the homepage recommendations a few times, you can read new novels. 4. Follow novel authors and read novels: Many authors have settled in the software. Follow or subscribe to them and you will receive timely update reminders.

How to implement the subscription and payment functions of the accounting system - How to use PHP to develop the paid accounting function requires specific code examples. With the rapid development of the Internet and mobile payments, subscription and payment functions have become an important part of many online services. In the accounting system, implementing subscription and payment functions can provide users with more personalized, safe and reliable services. This article will introduce how to use PHP language to develop the subscription and payment functions of the accounting system, and provide specific code examples. Create the database table first, in MySQL data

How to add subscription functionality to WordPress plug-in WordPress is a powerful content management system that is widely used in various websites. In order to enhance the interactivity of the website, many websites hope to provide users with a subscription function so that users can obtain the latest content updates in a timely manner. In WordPress, this function can be achieved by developing plug-ins. The following will introduce how to add subscription functionality to WordPress plugins and give specific code examples. First, before developing the plugin, we need

How to delete novels downloaded from mobile QQ browser? QQ Browser is rich in functions and easy to operate. Many users like to use this browser to work or study. QQ Browser can also handle various types of files. The videos and novels we download in this browser can be stored in QQ Browser. What should I do if I want to clear out the novels downloaded by many friends in my computer? Next, the editor will bring you the steps to delete downloaded novels on mobile QQ browser. Friends who are interested must not miss it. Steps to delete downloaded novels using mobile QQ browser First, find QQ browser on your mobile phone, select it and enter the main interface as shown in the picture. Next, please select the "three" menu button at the arrow in the picture (as shown in the picture). 2. The second step is to reach the "Personal Master"

Where can I find the novels collected by Quark Browser? Quark Browser provides a convenient novel collection function, which not only supports the collection of novels in the bookstore, but also can collect novels on major websites. However, many users are not clear about where to view the novels collected in Quark Browser. Next, the editor will bring you a detailed method of viewing novels collected by Quark Browser, let us explore together. Where to find the novels collected in Quark Browser 1. First, we need to open the software, and then on the home page of the software, click the [Book] button in the lower left corner to enter its interface; 2. In its interface, we can see all the books on the shelf novel, and then click on the novel to continue j to continue watching. The above is to view Quark browser collection
