微信快速开发框架(五)– 利用快速开发框架,快速搭建微信浏览博客园首页文章

2013/12 13 06:12

这几天接连发布了《快速开发微信公众平台框架---简介》和《体验微信公众平台快速开发框架》几篇关于微信平台的文章,不过反响一般,可能需求不是很多吧。闲来无事,还是继续改造一下这个框架。

今天更新了框架代码,听取了 @RMay 的建议,加入了一个信息中间件,用来处理xelement,避免了重复解析,所以所有接口都更改了下。此次更新如下:

1、增加信息中间件MiddleMessage

2、更改了接口参数类型,把原来的XElement都改成了MiddleMessage

3、删除了Demo项目,以后都用WebDemo进行演示。

所有代码都已经更新到我的Gibhub

介绍了更新内容,下面继续打造我们的Demo项目。

之前我们写的,都是返回文本信息,今天上午,我加入了一个CnblogsArticleNewsMessageHandler,主要是返回一个ResponseNewsMessage(图文信息),只要发消息:博客园文章,就能获取在首页前5的文章列表,但为了避免给博客园造成鸭梨,我把信息缓存了下,10分钟更新一次。这次主要采用了webclient+正则的方式,采集的方式无所谓,大家都可以自由发挥。

先看下CnblogsArticleNewsMessageHandler:

public class CnblogsArticleNewsMessageHandler : IMessageHandler
    {
        public ResponseMessage HandlerRequestMessage(MiddleMessage msg)
        {
            //var request = new RequestTextMessage(xml);
            var response = new ResponseNewsMessage(msg.RequestMessage);
            var cnblogsFeed = new CnBlogsFeed(5);
            var articles = cnblogsFeed.GetTopCnblogsFeed();
            response.ArticleCount = articles.Count;
            response.CreateTime = DateTime.Now.Ticks;
            response.Articles = articles;

            return response;
        }
    }

大家可以看到,接口参数已经改成了MiddleMessage,这样就避免了原先我再new一个RequestMessage了, 直接用了MiddleMessage.RequestMessage。

CnBlogsFeed是一个自己写的采集类,目的是采集博客园首页数据,数字类型的构造函数,是一个提取数量,因为微信平台的限制,这个值必须在1-10之间。

因为是图文消息,而博客园呢只在Description中提供了用户的头像,而微信多图文消息会把第一篇文章的图片作为主图,大小为:320*200,所以我把第一张图片做成了默认图片,小图的话如果用户有头像就用用户的头像,如果没有则会显示一个默认小图,大小为:200*200。

看下CnBlogsFeed类,写的不好,将就看看吧:

public class CnBlogsFeed
    {
        private int m_topNum = 5;

        //缓存过期时间,这里是10分钟
        private static int s_timeout = 10 * 60 * 1000;
        //缓存过期时间
        private static DateTime s_outDate = DateTime.Now;
        //博客园文章列表正则表达式
        private static Regex s_cnblogsIndexRegex = new Regex("\\s*.*\\s*.*\\s*.*\\s*.*\\s*.*\\s*.*\\s*.*\\s*\\s*

.*)\"\\s*target=\"_blank\">(?.*)</a>.*\\s*<p\\s*class=\"post_item_summary\">\\s*(?<content>.*)\\s*</p>"</span><span style="background: white; color: black;">); </span><span style="background: white; color: green;">//内容中,用户头像正则表达式 </span><span style="background: white; color: blue;">private static </span><span style="background: white; color: #2b91af;">Regex </span><span style="background: white; color: black;">s_picUrlRegex = </span><span style="background: white; color: blue;">new </span><span style="background: white; color: #2b91af;">Regex</span><span style="background: white; color: black;">(</span><span style="background: white; color: #a31515;">"src=\"(?<picurl>.*)\"\\s"</span><span style="background: white; color: black;">); </span><span style="background: white; color: green;">//博客园文章列表uri </span><span style="background: white; color: blue;">private static string </span><span style="background: white; color: black;">s_cnblogsIndexUri = </span><span style="background: white; color: #a31515;">"http://www.cnblogs.com/mvc/AggSite/PostList.aspx?CategoryId=808&PageIndex=1"</span><span style="background: white; color: black;">; </span><span style="background: white; color: green;">//默认的一个大图,一个小图的图片地址 </span><span style="background: white; color: blue;">private static string </span><span style="background: white; color: black;">s_defaultBigPicUri = </span><span style="background: white; color: #a31515;">"http://wx.jamesying.com/images/default_title.jpg"</span><span style="background: white; color: black;">; </span><span style="background: white; color: blue;">private static string </span><span style="background: white; color: black;">s_defaultSmallPicUri = </span><span style="background: white; color: #a31515;">"http://wx.jamesying.com/images/default_small.jpg"</span><span style="background: white; color: black;">; </span><span style="background: white; color: green;">//用来缓存请求过来的数据,不高兴用Cache了。 </span><span style="background: white; color: blue;">private static </span><span style="background: white; color: #2b91af;">List</span><span style="background: white; color: black;"><</span><span style="background: white; color: #2b91af;">Article</span><span style="background: white; color: black;">> s_articles = </span><span style="background: white; color: blue;">null</span><span style="background: white; color: black;">; </span><span style="background: white; color: blue;">public </span><span style="background: white; color: black;">CnBlogsFeed(</span><span style="background: white; color: blue;">int </span><span style="background: white; color: black;">topNum) { m_topNum = topNum; } </span><span style="background: white; color: blue;">public </span><span style="background: white; color: #2b91af;">List</span><span style="background: white; color: black;"><</span><span style="background: white; color: #2b91af;">Article</span><span style="background: white; color: black;">> GetTopCnblogsFeed() { </span><span style="background: white; color: blue;">if </span><span style="background: white; color: black;">(s_articles == </span><span style="background: white; color: blue;">null</span><span style="background: white; color: black;">) { GetTopCnblogsFeed(m_topNum); } </span><span style="background: white; color: blue;">else </span><span style="background: white; color: black;">{ </span><span style="background: white; color: blue;">if </span><span style="background: white; color: black;">(</span><span style="background: white; color: #2b91af;">DateTime</span><span style="background: white; color: black;">.Now > s_outDate) { GetTopCnblogsFeed(m_topNum); } } </span><span style="background: white; color: blue;">return </span><span style="background: white; color: black;">s_articles; } </span><span style="background: white; color: blue;">private void </span><span style="background: white; color: black;">GetTopCnblogsFeed(</span><span style="background: white; color: blue;">int </span><span style="background: white; color: black;">m_topNum) { </span><span style="background: white; color: blue;">try </span><span style="background: white; color: black;">{ </span><span style="background: white; color: blue;">var </span><span style="background: white; color: black;">html = GetRemoteUri(s_cnblogsIndexUri, </span><span style="background: white; color: #2b91af;">Encoding</span><span style="background: white; color: black;">.UTF8); </span><span style="background: white; color: blue;">var </span><span style="background: white; color: black;">matchs = s_cnblogsIndexRegex.Matches(html); </span><span style="background: white; color: blue;">var </span><span style="background: white; color: black;">i = 0; s_articles = </span><span style="background: white; color: blue;">new </span><span style="background: white; color: #2b91af;">List</span><span style="background: white; color: black;"><</span><span style="background: white; color: #2b91af;">Article</span><span style="background: white; color: black;">>(); </span><span style="background: white; color: blue;">foreach </span><span style="background: white; color: black;">(</span><span style="background: white; color: #2b91af;">Match </span><span style="background: white; color: black;">match </span><span style="background: white; color: blue;">in </span><span style="background: white; color: black;">matchs) { </span><span style="background: white; color: blue;">if </span><span style="background: white; color: black;">(i >= m_topNum) </span><span style="background: white; color: blue;">break</span><span style="background: white; color: black;">; </span><span style="background: white; color: blue;">var </span><span style="background: white; color: black;">article = </span><span style="background: white; color: blue;">new </span><span style="background: white; color: #2b91af;">Article </span><span style="background: white; color: black;">{ Title = match.Groups[2].Value, Url = match.Groups[1].Value, Description = match.Groups[3].Value }; </span><span style="background: white; color: blue;">if </span><span style="background: white; color: black;">(i == 0) { article.PicUrl = s_defaultBigPicUri; } </span><span style="background: white; color: blue;">else </span><span style="background: white; color: black;">{ </span><span style="background: white; color: blue;">var </span><span style="background: white; color: black;">matchPic = s_picUrlRegex.Match(article.Description); </span><span style="background: white; color: blue;">if </span><span style="background: white; color: black;">(matchPic.Success) { article.PicUrl = matchPic.Groups[1].Value; } </span><span style="background: white; color: blue;">else </span><span style="background: white; color: black;">{ article.PicUrl = s_defaultSmallPicUri; } } s_articles.Add(article); i += 1; } s_outDate = </span><span style="background: white; color: #2b91af;">DateTime</span><span style="background: white; color: black;">.Now.AddMilliseconds(s_timeout); } </span><span style="background: white; color: blue;">catch</span><span style="background: white; color: black;">(</span><span style="background: white; color: #2b91af;">Exception </span><span style="background: white; color: black;">ex) { s_articles = </span><span style="background: white; color: blue;">null</span><span style="background: white; color: black;">; s_outDate = </span><span style="background: white; color: #2b91af;">DateTime</span><span style="background: white; color: black;">.Now; </span><span style="background: white; color: blue;">#if </span><span style="background: white; color: black;">DEBUG </span><span style="background: white; color: blue;">throw </span><span style="background: white; color: black;">ex; </span><span style="background: white; color: blue;">#endif </span><span style="background: white; color: black;">} </span><span style="background: white; color: green;">//return s_articles; </span><span style="background: white; color: black;">} </span><span style="background: white; color: blue;">private string </span><span style="background: white; color: black;">GetRemoteUri(</span><span style="background: white; color: blue;">string </span><span style="background: white; color: black;">uri, </span><span style="background: white; color: #2b91af;">Encoding </span><span style="background: white; color: black;">encoding) { </span><span style="background: white; color: blue;">var </span><span style="background: white; color: black;">client = </span><span style="background: white; color: blue;">new </span><span style="background: white; color: #2b91af;">WebClient</span><span style="background: white; color: black;">(); client.Encoding = encoding; </span><span style="background: white; color: blue;">return </span><span style="background: white; color: black;">client.DownloadString(uri); } }</span></pre> <p>基本工作完成,只要更改之前的TextMessageRole:</p> <pre class="code"><span style="background: white; color: blue;">public </span><span style="background: white; color: #2b91af;">IMessageHandler </span><span style="background: white; color: black;">MessageRole(</span><span style="background: white; color: #2b91af;">MiddleMessage </span><span style="background: white; color: black;">msg) { </span><span style="background: white; color: blue;">var </span><span style="background: white; color: black;">request = (</span><span style="background: white; color: #2b91af;">RequestTextMessage</span><span style="background: white; color: black;">)msg.RequestMessage; </span><span style="background: white; color: blue;">if </span><span style="background: white; color: black;">(request.Content.IndexOf(</span><span style="background: white; color: #a31515;">"博客园文章"</span><span style="background: white; color: black;">) > -1) { </span><span style="background: white; color: blue;">return new </span><span style="background: white; color: #2b91af;">CnblogsArticleNewsMessageHandler</span><span style="background: white; color: black;">(); } </span><span style="background: white; color: blue;">if </span><span style="background: white; color: black;">(request.Content.IndexOf(</span><span style="background: white; color: #a31515;">"博客园"</span><span style="background: white; color: black;">) > -1) { </span><span style="background: white; color: blue;">return new </span><span style="background: white; color: #2b91af;">CnblogsTextMessageHandler</span><span style="background: white; color: black;">(); } </span><span style="background: white; color: blue;">return new </span><span style="background: white; color: #2b91af;">DefaultMessageHandler</span><span style="background: white; color: black;">(); }</span></pre> <p><span style="color: #000000;">这个规则简陋了点,之后会考虑下,打造一个文本命令的规范,因为Demo还不涉及到数据库,暂时都是手工判断。</span></p> <p>接下来上传代码,测试一下:</p> <p>输入博客园:</p> <p><a href="http://images.cnitblog.com/blog/4871/201312/13143407-0b2b7a8a0a9a44af84187a9f4691b631.png"><img loading="lazy" style="display: inline; border: 0px;" title="image" src="http://images.cnitblog.com/blog/4871/201312/13143409-836657795eac4318b22c42cf5c3e926d.png" alt="image" width="584" height="151" border="0" /></a></p> <p> </p> <p><span style="color: #444444;">输入博客园文章:</span></p> <p><a href="http://images.cnitblog.com/blog/4871/201312/13143409-978ee05105b04132a5c0ae164215a0bd.png"><img loading="lazy" style="display: inline; border: 0px;" title="image" src="http://images.cnitblog.com/blog/4871/201312/13143410-726a2763bb17425f94803d27e6c90dff.png" alt="image" width="573" height="357" border="0" /></a></p> <p> </p> <p> </p> <p>测试完成,还能凑活用用,后续会用一个统一的文本命令方式,但有点纠结,不知道用什么方式,大家可以提供下意见。目前想到的是:</p> <p>关键字+命令+参数(可选)</p> <p>博客园+inday+5(博客园,用户为inday,前5文章)</p> <p>天气+上海(获取上海今天的天气)</p> <p>天气+上海+3(获取上海未来3天的天气)</p> <p>后面会写一系列教程,尽量把常用的消息类型都用到。</p> <p>PS:求职下吧,上海地区+电子商务类型公司,最好有旅游行业,职位的话无所谓,一个抬头而已,有发展前景,因本人30+了,不太想经常换工作了,薪资12k+就行,对于自我评价,还算是个负责的人,项目也好,学习也好,都会投入进去,对于C#比较精通点,也可以其他语言。需要的Email给我:james#taogame.com(#->@)</p> <p>PS2:今天收到宝宝的台历了,哈,真嗲</p> <p class="clear"></p><p>--转载请注明: <a class="oloCopy" href="http://www.jamesying.com/2013/12/13/%e5%be%ae%e4%bf%a1%e5%bf%ab%e9%80%9f%e5%bc%80%e5%8f%91%e6%a1%86%e6%9e%b6%ef%bc%88%e4%ba%94%ef%bc%89-%e5%88%a9%e7%94%a8%e5%bf%ab%e9%80%9f%e5%bc%80%e5%8f%91%e6%a1%86%e6%9e%b6%ef%bc%8c%e5%bf%ab%e9%809/">http://www.jamesying.com/2013/12/13/%e5%be%ae%e4%bf%a1%e5%bf%ab%e9%80%9f%e5%bc%80%e5%8f%91%e6%a1%86%e6%9e%b6%ef%bc%88%e4%ba%94%ef%bc%89-%e5%88%a9%e7%94%a8%e5%bf%ab%e9%80%9f%e5%bc%80%e5%8f%91%e6%a1%86%e6%9e%b6%ef%bc%8c%e5%bf%ab%e9%809/</a></p> </section> <footer> <span class="author"> 作者 <a href="http://www.jamesying.com/author/jamesying/" title="由jamesying发布" rel="author">jamesying</a> </span> - <span class="cat-links"> 分类 <a href="http://www.jamesying.com/category/%e5%be%ae%e4%bf%a1%e5%85%ac%e4%bc%97%e5%8f%b7%e5%bf%ab%e9%80%9f%e5%bc%80%e5%8f%91%e6%a1%86%e6%9e%b6/" rel="category tag">微信公众号快速开发框架</a>, <a href="http://www.jamesying.com/category/uncategorized/" rel="category tag">未分类</a> </span> </footer> </article><!-- #post-80 --> <script type="text/javascript" charset="utf-8"> var changeMsg = "(打开)"; var closeMsg = "(关闭)"; function isnull(val){ if (val != null) { var str = val.replace(/(^\s*)|(\s*$)/g, '');//Remove blank space } if(str == '' || str == undefined || str == null){ jQuery('#comment-author-info').show(); jQuery('.comment-welcomeback').hide(); }else{ jQuery('.comment-welcomeback').show(); jQuery('#comment-author-info').hide(); } } function olo_toggleCommentAuthorInfo() { jQuery('#comment-author-info').slideToggle('slow', function(){ if ( jQuery('#comment-author-info').css('display') == 'none' ) { jQuery('#toggle-comment-author-info').text(changeMsg); } else { jQuery('#toggle-comment-author-info').text(closeMsg); } }); } jQuery(document).ready(function(jQuery) { isnull(jQuery('#author').val()); }); </script> <div id="respond" class="comment-respond"> <h3 id="reply-title" class="comment-reply-title">发表回复 <small><a rel="nofollow" id="cancel-comment-reply-link" href="/2013/12/13/%E5%BE%AE%E4%BF%A1%E5%BF%AB%E9%80%9F%E5%BC%80%E5%8F%91%E6%A1%86%E6%9E%B6%EF%BC%88%E4%BA%94%EF%BC%89-%E5%88%A9%E7%94%A8%E5%BF%AB%E9%80%9F%E5%BC%80%E5%8F%91%E6%A1%86%E6%9E%B6%EF%BC%8C%E5%BF%AB%E9%809/#respond" style="display:none;">取消回复</a></small></h3><form action="http://www.jamesying.com/wp-comments-post.php" method="post" id="commentform" class="comment-form" novalidate><div class="comment-welcomeback">欢迎回来 <strong></strong><a href="javascript:olo_toggleCommentAuthorInfo();" id="toggle-comment-author-info">(打开)</a></div><div id="comment-author-info" class="row"><p class="comment-form-author col-sm-4"><input class="form-control" id="author" name="author" type="text" value="" size="30" aria-required='true' /><label for="author">姓名</label> <span class="required">(必填)</span></p> <p class="comment-form-email col-sm-4"><input class="form-control" id="email" name="email" type="text" value="" size="30" aria-required='true' /><label for="email">电子邮件</label><span class="required">(必填)</span></p> <p class="comment-form-url col-sm-4"><input class="form-control" id="url" name="url" type="text" value="" size="30" /><label for="url">站点</label></p></div> <p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes" /> <label for="wp-comment-cookies-consent">在此浏览器中保存我的显示名称、邮箱地址和网站网址,以便下次评论时使用。</label></p> <p class="comment-form-comment"><textarea class="form-control" aria-required="true" rows="8" cols="70" name="comment" id="comment" onkeydown="if(event.ctrlKey){if(event.keyCode==13){document.getElementById('submit').click();return false}};"></textarea></p><p class="form-submit"><input name="submit" type="submit" id="submit" class="btn btn-danger" value="发表评论" /> <input type='hidden' name='comment_post_ID' value='80' id='comment_post_ID' /> <input type='hidden' name='comment_parent' id='comment_parent' value='0' /> </p><p style="display: none;"><input type="hidden" id="ak_js" name="ak_js" value="76"/></p></form> </div><!-- #respond --> </ol> <div class="clear"></div> <div class="clear"></div> <nav id="nav-single"> <p class="nav-previous"><a href="http://www.jamesying.com/2013/12/11/%e5%be%ae%e4%bf%a1%e5%bf%ab%e9%80%9f%e5%bc%80%e5%8f%91%e6%a1%86%e6%9e%b6%ef%bc%88%e5%9b%9b%ef%bc%89-%e4%bd%93%e9%aa%8c%e5%be%ae%e4%bf%a1%e5%85%ac%e4%bc%97%e5%b9%b3%e5%8f%b0%e5%bf%ab%e9%80%9f%e5%bc8/" rel="prev">上一篇: 微信快速开发框架(四)– 体验微信公众平台快速开发框架</a></p> <p class="nav-next"><a href="http://www.jamesying.com/2014/02/21/%e5%af%b9%e4%ba%8e%e5%a4%a7%e6%95%b0%e6%8d%ae%e5%a4%a7%e6%b5%81%e9%87%8f%e6%83%85%e5%86%b5%e4%b8%8b%e5%be%ae%e8%bd%af%e6%9e%b6%e6%9e%84%e7%9a%84%e6%b0%b4%e5%b9%b3%e6%89%a9%e5%b1%95%e7%9a%84%e9%81%90%e/" rel="next">下一篇: 对于大数据大流量情况下微软架构的水平扩展的遐想(瞎想)</a></p> </nav><!-- #nav-single --> </div><!--#oloPosts--> <aside id="oloWidget"> <ul> <li class="twitter_rss"> </li> <li id="categories-6" class="widget widget_categories"><h2><span class="star">分类</span></h2> <ul> <li class="cat-item cat-item-8"><a href="http://www.jamesying.com/category/abp/">Abp</a> </li> <li class="cat-item cat-item-4"><a href="http://www.jamesying.com/category/asp-net-core/">Asp.Net Core</a> </li> <li class="cat-item cat-item-20"><a href="http://www.jamesying.com/category/%e5%88%9b%e4%b8%9a%e4%b9%8b%e8%b7%af/">创业之路</a> </li> <li class="cat-item cat-item-7"><a href="http://www.jamesying.com/category/%e5%a4%a9%e9%a9%ac%e8%a1%8c%e7%a9%ba/">天马行空</a> </li> <li class="cat-item cat-item-5"><a href="http://www.jamesying.com/category/%e5%be%ae%e4%bf%a1%e5%85%ac%e4%bc%97%e5%8f%b7%e5%bf%ab%e9%80%9f%e5%bc%80%e5%8f%91%e6%a1%86%e6%9e%b6/">微信公众号快速开发框架</a> </li> <li class="cat-item cat-item-6"><a href="http://www.jamesying.com/category/%e5%be%ae%e6%9c%8d%e5%8a%a1%e6%9e%b6%e6%9e%84/">微服务架构</a> </li> <li class="cat-item cat-item-1"><a href="http://www.jamesying.com/category/uncategorized/">未分类</a> </li> <li class="cat-item cat-item-10"><a href="http://www.jamesying.com/category/%e7%bc%96%e7%a8%8b%e6%8a%80%e5%b7%a7/">编程技巧</a> </li> </ul> </li><li id="search-4" class="widget widget_search"><div id="olosearch"> <div class="svg-search"><svg class="icon icon-search" aria-hidden="true" role="img"> <use href="#icon-search" xlink:href="#icon-search"></use> </svg></div> <form method="get" id="searchform" action="http://www.jamesying.com/" > <input type="text" class="field" id="s" name="s" value="" placeholder="Search...Enter" required="required" /> <input type="submit" class="submit" name="submit" id="searchsubmit" value="Search" /> </form> </div></li><li id="tag_cloud-3" class="widget widget_tag_cloud"><h2><span class="star">标签</span></h2><div class="tagcloud"><a href="http://www.jamesying.com/tag/flag/" class="tag-cloud-link tag-link-13 tag-link-position-1" style="font-size: 8pt;" aria-label="flag (1个项目)">flag</a> <a href="http://www.jamesying.com/tag/mac/" class="tag-cloud-link tag-link-18 tag-link-position-2" style="font-size: 8pt;" aria-label="mac (1个项目)">mac</a> <a href="http://www.jamesying.com/tag/mbp/" class="tag-cloud-link tag-link-19 tag-link-position-3" style="font-size: 8pt;" aria-label="mbp (1个项目)">mbp</a> <a href="http://www.jamesying.com/tag/%e5%88%9b%e5%a7%8b%e4%ba%ba%e6%89%8b%e8%ae%b0/" class="tag-cloud-link tag-link-16 tag-link-position-4" style="font-size: 8pt;" aria-label="创始人手记 (1个项目)">创始人手记</a> <a href="http://www.jamesying.com/tag/%e8%82%a1%e6%9d%83%e8%ae%be%e8%ae%a1/" class="tag-cloud-link tag-link-15 tag-link-position-5" style="font-size: 8pt;" aria-label="股权设计 (1个项目)">股权设计</a> <a href="http://www.jamesying.com/tag/%e8%82%a1%e7%a5%a8/" class="tag-cloud-link tag-link-14 tag-link-position-6" style="font-size: 8pt;" aria-label="股票 (1个项目)">股票</a> <a href="http://www.jamesying.com/tag/%e8%af%bb%e4%b9%a6%e7%ac%94%e8%ae%b0/" class="tag-cloud-link tag-link-17 tag-link-position-7" style="font-size: 8pt;" aria-label="读书笔记 (1个项目)">读书笔记</a></div> </li> <li id="recent-posts-4" class="widget widget_recent_entries"> <h2><span class="star">近期文章</span></h2> <ul> <li> <a href="http://www.jamesying.com/2021/05/15/%e4%b8%80%e4%ba%9b%e5%85%b3%e4%ba%8eabp%e8%a6%81%e6%b3%a8%e6%84%8f%e7%9a%84%e5%9c%b0%e6%96%b9/">一些关于abp要注意的地方</a> </li> <li> <a href="http://www.jamesying.com/2021/04/25/%e6%bf%80%e6%83%85%e8%a4%aa%e5%8e%bb%ef%bc%8c%e5%89%a9%e4%b8%8b%e7%9a%84%e5%8f%aa%e6%9c%89%e6%97%a0%e9%99%90%e7%9a%84%e7%9e%8e%e6%83%b3/">激情褪去,剩下的只有无限的瞎想</a> </li> <li> <a href="http://www.jamesying.com/2021/03/24/%e8%80%81macbook-pro%e5%ae%89%e8%a3%85%e6%96%b0%e7%b3%bb%e7%bb%9f/">我的MacBook Pro 09 Middle安装上了High Sierra</a> </li> <li> <a href="http://www.jamesying.com/2021/03/03/2021%e5%b9%b43%e6%9c%88%e6%9c%80%e8%bf%91%e6%9c%89%e7%82%b9%e7%83%a6/">2021年3月最近有点烦</a> </li> <li> <a href="http://www.jamesying.com/2021/02/10/2020%e5%b9%b4%e8%82%a1%e5%b8%82%e6%80%bb%e7%bb%93/">2020年股市总结</a> </li> </ul> </li> </ul> </aside><!-- #oloWidget--> </div><!-- #oloContent--> </div><!-- #oloContainer--> <div class="clear"></div> <footer> <div class="copyright"> <p>CopyRight © 2021 <a href="http://www.jamesying.com" title="脑洞的蜂蜜">脑洞的蜂蜜</a>. <a href="https://hjyl.org/" title="Designed by hjyl.org">olo Theme</a> 由 <a href="https://wordpress.org/">WordPress</a> 强力驱动</p> <p><a href="https://beian.miit.gov.cn/" rel="external nofollow" target="_blank">沪ICP备13016727号</a></p> </div> <div id="oloUp"> <i><svg class="icon icon-arrow-up" aria-hidden="true" role="img"> <use href="#icon-arrow-up" xlink:href="#icon-arrow-up"></use> </svg></i> </div> </footer> <script type='text/javascript' id='cnblog_levi_imp-js-extra'> /* <![CDATA[ */ var imp_data = {"ajaxurl":"http:\/\/www.jamesying.com\/wp-admin\/admin-ajax.php","_wpnonce":"a8b21bfd27"}; /* ]]> */ </script> <script type='text/javascript' src='http://www.jamesying.com/wp-content/plugins/cnblogs2wp/js/import.js?ver=5.7.2' id='cnblog_levi_imp-js'></script> <script type='text/javascript' src='http://www.jamesying.com/wp-content/themes/olo/js/olo.js?ver=20200903' id='olo-js'></script> <script type='text/javascript' src='http://www.jamesying.com/wp-includes/js/comment-reply.min.js?ver=5.7.2' id='comment-reply-js'></script> <script type='text/javascript' id='ajax-comment-js-extra'> /* <![CDATA[ */ var ajaxcomment = {"ajax_url":"http:\/\/www.jamesying.com\/wp-admin\/admin-ajax.php","order":"asc","formpostion":"bottom","txt1":"\u8bf7\u7a0d\u5019...","txt2":"\u63d0\u4ea4\u6210\u529f"}; /* ]]> */ </script> <script type='text/javascript' src='http://www.jamesying.com/wp-content/themes/olo/js/comments-ajax.js?ver=20200903' id='ajax-comment-js'></script> <script type='text/javascript' src='http://www.jamesying.com/wp-includes/js/wp-embed.min.js?ver=5.7.2' id='wp-embed-js'></script> <svg style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <symbol id="icon-search" viewBox="0 0 30 32"> <path class="path1" d="M20.571 14.857q0-3.304-2.348-5.652t-5.652-2.348-5.652 2.348-2.348 5.652 2.348 5.652 5.652 2.348 5.652-2.348 2.348-5.652zM29.714 29.714q0 0.929-0.679 1.607t-1.607 0.679q-0.964 0-1.607-0.679l-6.125-6.107q-3.196 2.214-7.125 2.214-2.554 0-4.884-0.991t-4.018-2.679-2.679-4.018-0.991-4.884 0.991-4.884 2.679-4.018 4.018-2.679 4.884-0.991 4.884 0.991 4.018 2.679 2.679 4.018 0.991 4.884q0 3.929-2.214 7.125l6.125 6.125q0.661 0.661 0.661 1.607z"></path> </symbol> <symbol id="icon-twitter" viewBox="0 0 30 32"> <path class="path1" d="M28.929 7.286q-1.196 1.75-2.893 2.982 0.018 0.25 0.018 0.75 0 2.321-0.679 4.634t-2.063 4.437-3.295 3.759-4.607 2.607-5.768 0.973q-4.839 0-8.857-2.589 0.625 0.071 1.393 0.071 4.018 0 7.161-2.464-1.875-0.036-3.357-1.152t-2.036-2.848q0.589 0.089 1.089 0.089 0.768 0 1.518-0.196-2-0.411-3.313-1.991t-1.313-3.67v-0.071q1.214 0.679 2.607 0.732-1.179-0.786-1.875-2.054t-0.696-2.75q0-1.571 0.786-2.911 2.161 2.661 5.259 4.259t6.634 1.777q-0.143-0.679-0.143-1.321 0-2.393 1.688-4.080t4.080-1.688q2.5 0 4.214 1.821 1.946-0.375 3.661-1.393-0.661 2.054-2.536 3.179 1.661-0.179 3.321-0.893z"></path> </symbol> <symbol id="icon-bars" viewBox="0 0 24 24"> <path d="M5,21 L5,1 L7,1 L7,2 L21.1247446,2 L18.1259893,7.99991055 L21.126034,14 L7,14 L7,21 L8,21 L8,23 L4,23 L4,21 L5,21 Z M7,12 L17.889966,12 L15.8900107,8.00008945 L17.8892554,4 L7,4 L7,12 Z"/> </symbol> <symbol id="icon-chain" viewBox="0 0 30 32"> <path class="path1" d="M26 21.714q0-0.714-0.5-1.214l-3.714-3.714q-0.5-0.5-1.214-0.5-0.75 0-1.286 0.571 0.054 0.054 0.339 0.33t0.384 0.384 0.268 0.339 0.232 0.455 0.063 0.491q0 0.714-0.5 1.214t-1.214 0.5q-0.268 0-0.491-0.063t-0.455-0.232-0.339-0.268-0.384-0.384-0.33-0.339q-0.589 0.554-0.589 1.304 0 0.714 0.5 1.214l3.679 3.696q0.482 0.482 1.214 0.482 0.714 0 1.214-0.464l2.625-2.607q0.5-0.5 0.5-1.196zM13.446 9.125q0-0.714-0.5-1.214l-3.679-3.696q-0.5-0.5-1.214-0.5-0.696 0-1.214 0.482l-2.625 2.607q-0.5 0.5-0.5 1.196 0 0.714 0.5 1.214l3.714 3.714q0.482 0.482 1.214 0.482 0.75 0 1.286-0.554-0.054-0.054-0.339-0.33t-0.384-0.384-0.268-0.339-0.232-0.455-0.063-0.491q0-0.714 0.5-1.214t1.214-0.5q0.268 0 0.491 0.063t0.455 0.232 0.339 0.268 0.384 0.384 0.33 0.339q0.589-0.554 0.589-1.304zM29.429 21.714q0 2.143-1.518 3.625l-2.625 2.607q-1.482 1.482-3.625 1.482-2.161 0-3.643-1.518l-3.679-3.696q-1.482-1.482-1.482-3.625 0-2.196 1.571-3.732l-1.571-1.571q-1.536 1.571-3.714 1.571-2.143 0-3.643-1.5l-3.714-3.714q-1.5-1.5-1.5-3.643t1.518-3.625l2.625-2.607q1.482-1.482 3.625-1.482 2.161 0 3.643 1.518l3.679 3.696q1.482 1.482 1.482 3.625 0 2.196-1.571 3.732l1.571 1.571q1.536-1.571 3.714-1.571 2.143 0 3.643 1.5l3.714 3.714q1.5 1.5 1.5 3.643z"></path> </symbol> <symbol id="icon-thumb-tack" viewBox="0 0 21 32"> <path class="path1" d="M8.571 15.429v-8q0-0.25-0.161-0.411t-0.411-0.161-0.411 0.161-0.161 0.411v8q0 0.25 0.161 0.411t0.411 0.161 0.411-0.161 0.161-0.411zM20.571 21.714q0 0.464-0.339 0.804t-0.804 0.339h-7.661l-0.911 8.625q-0.036 0.214-0.188 0.366t-0.366 0.152h-0.018q-0.482 0-0.571-0.482l-1.357-8.661h-7.214q-0.464 0-0.804-0.339t-0.339-0.804q0-2.196 1.402-3.955t3.17-1.759v-9.143q-0.929 0-1.607-0.679t-0.679-1.607 0.679-1.607 1.607-0.679h11.429q0.929 0 1.607 0.679t0.679 1.607-0.679 1.607-1.607 0.679v9.143q1.768 0 3.17 1.759t1.402 3.955z"></path> </symbol> <symbol id="icon-time" viewBox="0 0 24 24"> <path class="path1" d="M12,23 C5.92486775,23 1,18.0751322 1,12 C1,5.92486775 5.92486775,1 12,1 C18.0751322,1 23,5.92486775 23,12 C23,18.0751322 18.0751322,23 12,23 Z M12,21 C16.9705627,21 21,16.9705627 21,12 C21,7.02943725 16.9705627,3 12,3 C7.02943725,3 3,7.02943725 3,12 C3,16.9705627 7.02943725,21 12,21 Z M13,11 L17,11 L17,13 L11,13 L11,6 L13,6 L13,11 Z"/> </symbol> <symbol id="icon-tags" viewBox="0 0 482.4 482.4"> <path d="M458.6,23.786c-14.5-14.5-34.5-22.9-56.3-23.7c-20.7-0.8-41.9,5-61.1,16.8c-8.5,5.2-11.2,16.3-6,24.7 c5.2,8.5,16.3,11.2,24.7,6c26.1-16,56.2-15.3,73.2,1.7c10,10,14.6,24.5,12.9,40.8c-1.8,17.7-10.5,35.1-24.5,49.1 s-31.5,22.7-49.1,24.5c-16.3,1.6-30.8-3-40.8-12.9c-6.5-6.5-15.1-10-24.2-10c-9.2,0-17.8,3.6-24.3,10c-6.5,6.5-10,15.1-10,24.3 s3.6,17.8,10.1,24.3s15.1,10,24.2,10c9.2,0,17.8-3.6,24.3-10c1.4-1.4,2.7-2.9,3.8-4.5c9.5,3.4,19.7,5.2,30.5,5.2 c3.3,0,6.7-0.2,10.1-0.5c0.3,0,0.6-0.1,0.9-0.1l3.1,44.9c0.7,10.2-3.1,20.2-10.3,27.5l-167.7,167.5c-9.4,9.4-24.8,9.4-34.2,0 L43,314.486c-4.6-4.6-7.1-10.7-7.1-17.1c0-6.5,2.5-12.5,7.1-17.1l167.6-167.6c7.2-7.2,17.2-11,27.4-10.3l148.9,9.9 c9.9,0.7,18.5-6.8,19.2-16.8c0.7-9.9-6.8-18.5-16.8-19.2l-148.9-9.9c-20.5-1.4-40.7,6.2-55.2,20.8l-167.6,167.6 c-11.4,11.4-17.6,26.5-17.6,42.6c0,16.1,6.3,31.2,17.6,42.6l124.8,124.8c11.7,11.7,27.2,17.6,42.6,17.6c15.4,0,30.8-5.9,42.6-17.6 l167.6-167.6c14.6-14.6,22.2-34.8,20.8-55.4l-3.6-52.6c12.6-6,24.3-14.3,34.7-24.6c19.8-19.8,32.2-45,34.8-70.9 C484.6,66.386,476.3,41.586,458.6,23.786z"/> </symbol> <symbol id="icon-home" viewBox="-51 0 512 512"><path d="m205.117188 0c-113.101563 0-205.117188 92.015625-205.117188 205.117188v5.667968c0 57.199219 32.792969 123.855469 97.472656 198.113282 46.886719 53.832031 93.121094 91.367187 95.066406 92.941406l12.578126 10.160156 12.574218-10.160156c1.945313-1.574219 48.175782-39.109375 95.066406-92.941406 64.679688-74.257813 97.472657-140.914063 97.472657-198.113282v-5.667968c0-113.101563-92.015625-205.117188-205.113281-205.117188zm165.089843 210.785156c0 96.664063-124.550781 213.679688-165.089843 249.203125-40.554688-35.535156-165.09375-152.542969-165.09375-249.203125v-5.667968c0-91.035157 74.058593-165.09375 165.09375-165.09375 91.03125 0 165.089843 74.058593 165.089843 165.09375zm-185.101562-14.675781h40.019531v40.023437h-40.019531zm20.519531-114.136719-121.5 110.839844 26.9375 29.527344v36.804687c0 27.585938 22.441406 50.03125 50.027344 50.03125h90.050781c27.585937 0 50.027344-22.445312 50.027344-50.03125v-37.886719l25.953125-28.445312zm45.515625 187.179688h-90.050781c-5.515625 0-10.003906-4.488282-10.003906-10.007813v-73.242187l54.539062-49.753906 55.523438 50.652343v72.34375c0 5.519531-4.488282 10.007813-10.007813 10.007813zm0 0"/> </symbol> <symbol id="icon-weibo" viewBox="0, 0, 300, 300"><path d="M196.802 39.964c-8.656 3.787-10.64 12.803-4.328 19.115 3.066 3.066 5.951 3.607 18.574 3.607 17.673 0 29.575 4.688 38.592 15.148 11 12.443 12.263 16.23 12.263 38.952 0 20.197 0 20.558 4.688 23.263 10.82 6.131 18.034-1.443 20.558-21.64 3.246-26.329-12.443-56.986-36.066-71.052-15.509-9.016-42.018-12.623-54.281-7.393zm-88.724 33.542c-20.198 7.213-39.674 21.099-60.592 43.46-49.592 52.658-46.346 102.791 8.295 129.48 56.805 27.771 133.267 18.574 174.924-21.099 31.198-29.575 27.411-66.724-8.115-79.347-6.312-2.164-8.296-3.787-7.394-5.771 3.246-7.934 4.328-17.131 2.525-22.541-5.591-17.132-25.968-21.099-56.264-10.82l-12.083 4.147 1.082-12.082c1.263-14.246-1.803-22.001-10.279-26.329-7.033-3.607-20.558-3.246-32.099.902zm50.133 69.789c26.869 7.394 43.28 23.624 43.28 42.919 0 21.46-19.116 40.756-50.133 51.035-16.591 5.41-47.428 6.492-62.576 2.344-28.673-8.115-44.903-23.984-44.903-44.362 0-11.181 4.869-20.919 15.509-30.837 9.918-9.377 17.492-13.886 32.099-18.755 22.001-7.393 45.625-8.295 66.724-2.344zm-56.806 17.492c-18.213 8.476-27.951 21.46-27.951 37.69 0 14.788 6.492 24.886 20.738 32.46 11 5.951 31.198 5.41 43.461-.901 15.689-8.296 25.968-23.624 25.968-38.592-.181-12.263-11.001-26.87-23.804-32.099-10.279-4.328-27.592-3.607-38.412 1.442zm13.165 33.903c1.262 1.262 2.164 4.328 2.164 7.033 0 9.017-15.148 16.411-21.28 10.279-3.426-3.426-2.524-11.902 1.443-15.869 3.967-3.968 14.246-4.869 17.673-1.443zm85.298-117.758c-8.296 8.296-2.705 18.214 10.459 18.214 11.361 0 16.41 5.771 16.41 18.755 0 8.115.722 10.459 3.968 12.623 9.738 6.853 17.673-.721 17.673-16.771 0-19.656-14.067-34.444-34.084-35.887-9.016-.721-11.18-.18-14.426 3.066z"/> </symbol> <symbol id="icon-qrcode" viewBox="0 0 24 24"> <path fill-rule="evenodd" d="M2,13 L2,11 L22,11 L22,13 L2,13 Z M16,22 L16,20 L20,20 L20,16 L22,16 L22,20 C22,21.1045695 21.1859723,22 20.1818182,22 L16,22 Z M8,22 L3.81818182,22 C2.81402773,22 2,21.1045695 2,20 L2,16 L4,16 L4,20 L8,20 L8,22 Z M16,2 L20.1818182,2 C21.1859723,2 22,2.8954305 22,4 L22,8 L20,8 L20,4 L16,4 L16,2 Z M8,2 L8,4 L4,4 L4,8 L2,8 L2,4 C2,2.8954305 2.81402773,2 3.81818182,2 L8,2 Z"/> </symbol> <symbol id="icon-email" viewBox="0 0 488.901 488.901"> <path d="M462.4,60.05H26.6C11.9,60.05,0,71.95,0,86.65v315.6c0,14.7,11.9,26.6,26.6,26.6h435.7c14.7,0,26.6-11.9,26.6-26.6V86.65 C489,72.05,477,60.05,462.4,60.05z M452.9,392.85H36V96.05h394.6l-183.6,157l-133.5-114.2c-7.6-6.5-18.9-5.6-25.4,2 c-6.5,7.6-5.6,18.9,2,25.4l145.2,124.2c0.2,0.2,0.4,0.3,0.5,0.4c0.2,0.2,0.4,0.3,0.6,0.5c0.3,0.2,0.7,0.5,1.1,0.7 c0.1,0.1,0.3,0.2,0.4,0.3c0.5,0.3,1,0.6,1.6,0.8c0.1,0.1,0.3,0.1,0.4,0.2c0.4,0.2,0.8,0.3,1.3,0.5c0.2,0.1,0.3,0.1,0.5,0.2 c0.4,0.1,0.8,0.2,1.2,0.3c0.2,0,0.4,0.1,0.5,0.1c0.4,0.1,0.9,0.2,1.3,0.2c0.2,0,0.3,0,0.5,0.1c0.6,0.1,1.2,0.1,1.8,0.1 c0.6,0,1.2,0,1.8-0.1c0.2,0,0.3,0,0.5-0.1c0.4-0.1,0.9-0.1,1.3-0.2c0.2,0,0.4-0.1,0.5-0.1c0.4-0.1,0.8-0.2,1.2-0.3 c0.2-0.1,0.3-0.1,0.5-0.2c0.4-0.1,0.9-0.3,1.3-0.5c0.1-0.1,0.3-0.1,0.4-0.2c0.5-0.2,1.1-0.5,1.6-0.8c0.1-0.1,0.3-0.2,0.4-0.3 c0.4-0.2,0.7-0.5,1.1-0.7c0.2-0.1,0.4-0.3,0.6-0.5c0.2-0.1,0.4-0.3,0.5-0.4l194.2-166.1V392.85z"/> </symbol> <symbol id="icon-arrow-up" viewBox="0 0 492.002 492.002"> <path d="M484.136,328.473L264.988,109.329c-5.064-5.064-11.816-7.844-19.172-7.844c-7.208,0-13.964,2.78-19.02,7.844 L7.852,328.265C2.788,333.333,0,340.089,0,347.297c0,7.208,2.784,13.968,7.852,19.032l16.124,16.124 c5.064,5.064,11.824,7.86,19.032,7.86s13.964-2.796,19.032-7.86l183.852-183.852l184.056,184.064 c5.064,5.06,11.82,7.852,19.032,7.852c7.208,0,13.96-2.792,19.028-7.852l16.128-16.132 C494.624,356.041,494.624,338.965,484.136,328.473z"/> </symbol> <symbol id="icon-feed" viewBox="0 0 512 512"> <path d="M307,439c-17,0-31-14-30-31c3-73-14-129-52-164c-60-56-151-46-152-46c-16,2-31-10-33-26s10-31,26-33c5-1,120-12,200,62 c51,48,75,117,71,209C336,426,323,439,307,439z M43,368c0-39,31-71,70-71s71,32,71,71c0,38-32,70-71,70C75,438,43,407,43,368z M439,439c-17,0-31-14-30-31c5-119-24-208-86-266C225,51,74,68,73,68c-16,2-31-10-33-26S50,10,66,8c7-1,180-20,298,90 c76,70,111,175,105,312C468,426,455,439,439,439z"/> </symbol> </defs> </svg> </body> </html>