2025年04月20日 11:17:57

安装了一条联通的 1000M 宽带,月费 99,安装费 199 全屋 FTTR 安装完之后感觉上当了。。。 测速上行 60M 下行 800M

2025年04月20日 01:30:14

红米电视

2025年04月19日 16:58:51

天然气的开户 和 电网的过户 都提交了,等待审核

2025年04月18日 10:07:44

腾讯也会有证书问题?😂

2025年04月18日 08:05:30

腾讯也会有证书问题?😂

2025年04月17日 20:48:07

测试

2025年04月17日 20:39:13

等待放假。。。

2025年04月17日 10:51:59

2025年04月16日 13:56:44

 siteurl . '/api/greader.php/accounts/ClientLogin?' . 

 http_build_query([

 'Email' => $this->user,

 'Passwd' => $this->password

 ]);



 $response = file_get_contents($loginUrl);

 if ($response === false) {

 throw new Exception('Login failed');

 }



 if (preg_match('/Auth=(.*)/', $response, $matches)) {

 $this->authToken = $matches[1];

 return true;

 }

 return false;

 }



 // 获取文章列表

 public function fetchArticles() {

 $articlesUrl = $this->siteurl . '/api/greader.php/reader/api/0/stream/contents/reading-list?&n=1000';

 $context = stream_context_create([

 'http' => [

 'method' => 'GET',

 'header' => "Authorization: GoogleLogin auth=" . $this->authToken

 ]

 ]);



 $response = file_get_contents($articlesUrl, false, $context);

 if ($response === false) {

 throw new Exception('Failed to fetch articles');

 }



 $data = json_decode($response, true);

 return $data['items'] ?? [];

 }



 // 获取订阅列表

 public function fetchSubscriptions() {

 $subscriptionsUrl = $this->siteurl . '/api/greader.php/reader/api/0/subscription/list?output=json';

 $context = stream_context_create([

 'http' => [

 'method' => 'GET',

 'header' => "Authorization: GoogleLogin auth=" . $this->authToken

 ]

 ]);



 $response = file_get_contents($subscriptionsUrl, false, $context);

 if ($response === false) {

 throw new Exception('Failed to fetch subscriptions');

 }



 $data = json_decode($response, true);

 return $data['subscriptions'] ?? [];

 }



 // 格式化文章数据

 private function formatArticles($articles, $subscriptions) {

 $subscriptionMap = [];

 foreach ($subscriptions as $subscription) {

 $subscriptionMap[$subscription['id']] = $subscription;

 }



 $formattedArticles = [];

 foreach ($articles as $article) {

 $strippedContent = strip_tags($article['summary']['content']);

 $short_desc = (strlen($strippedContent) > 99) 

 ? substr($strippedContent, 0, 99) . '...' 

 : $strippedContent;



 $subscriptionId = $article['origin']['streamId'];

 $subscription = $subscriptionMap[$subscriptionId] ?? null;



 $formattedArticles[] = [

 'site_name' => $article['origin']['title'],

 'title' => $article['title'],

 'link' => $article['alternate'][0]['href'],

 'time' => date('c', $article['published']),

 'description' => $short_desc,

 'icon' => $subscription 

 ? $this->siteurl . '/' . basename($subscription['iconUrl'])

 : ''

 ];

 }



 return $formattedArticles;

 }



 // 获取并处理所有数据

 public function getAllArticles() {

 try {

 if (!$this->login()) {

 throw new Exception('Login failed');

 }



 $articles = $this->fetchArticles();

 $subscriptions = $this->fetchSubscriptions();

 return $this->formatArticles($articles, $subscriptions);

 } catch (Exception $e) {

 error_log($e->getMessage());

 return [];

 }

 }

}



// 使用类获取数据并显示

try {

 $api = new FreshRSSAPI();

 $articles = $api->getAllArticles();



 // 对文章按时间排序

 usort($articles, function ($a, $b) {

 return strtotime($b['time']) - strtotime($a['time']);

 });



 // 设置每页显示的文章数量

 $itemsPerPage = 30;



 // 输出HTML

 echo '

朋友文章

通过Freshrss获取

'; foreach (array_slice($articles, 0, $itemsPerPage) as $article) { // 格式化发布时间 $date = new DateTime($article['time']); $date->setTimezone(new DateTimeZone('Asia/Shanghai')); $formattedDate = $date->format('Y年m月d日 H:i:s'); echo ''; } echo '
'; } catch (Exception $e) { echo '
获取文章失败:' . htmlspecialchars($e->getMessage()) . '
'; } ?>

2025年04月16日 13:55:47

今天热议的话题是订婚之后强行发生性关系算强奸,那结婚之后不同意依旧发生性关系那也算强奸,但凡女性不同意就不能发生性关系,那高价彩礼只会成为仙人跳的最终目的.一不注意就人财两空啊 结婚真是个高风险低收益的事情...