[Updated to 2.0] cnbeta extracts JS scripts of popular news based on the number of comments

Source: Internet
Author: User

Cnbeta is now a gathering place in the IT information industry. It is a great combination of high-end black and high-performance games.
By default, this script extracts news links from more than 20 comments on the cnbeta page. You can modify them by yourself. For more information, see notes.

 

Drag to the right of Ao you, chrome, and FF to link to your favorites in the browser ==>> cnbeta Hot Spray Article extraction plug-in

 

You can also manually add to favorites and edit the added URL as the following code. Note: This script does not support IE and IE core browsers.

Running Mode: click "add to Favorites" when you open the cnbeta homepage. The extracted information link is displayed on the page.

Code comments (you can modify them as needed ):

Note 1: arr [1]> = 20 here, '20' is the filtering condition, that is, the number of comments. By default, it is used to extract news with more than 20 comments. You can modify the basic style.

NOTE 2: Information on one page is filtered by default. to filter more information, we recommend that you click "view more information" at the bottom of the cnbeta homepage to display as much information as possible.

Note 3: The code can be run only once every refresh. To run the code for the second time, refresh the page and run the code again.

Javascript: var I; var iurl = document. getelementsbyclassname ("topic"); var url = iurl. item (I ). innerhtml; var IPL = document. getelementsbyclassname ("detail"); var PL = IPL. item (I ). innerhtml; var Re =/\ D +/g; var arr = pl. match (re); var box = []; var ibox; For (VAR I = 0; I <iurl. length; I ++) {var url = iurl. item (I ). innerhtml; var PL = IPL. item (I ). innerhtml; var Re =/\ D +/g; var arr = pl. match (re); If (ARR [1]> = 20) {box. push (I + "" + URL + "---" + "comment count:" + arr [1] + "<br>" + "<br> "); vaR ibox = document. getelementbyid ("head"); ibox = Box. tostring (); ibox = ibox. replace (/,/g, ""); ibox. style. color = "red"; ibox. style. textalign = "Left"; ibox. style. height = "100%"; ibox. style. marginbottom = "25px"; ibox. style. fontsize = "13px"; ibox. style. lineheight = "13px"; ibox. innerhtml = ibox }};

Nagging. Recently, I am preparing to set up a technical blog in the blog Park. I will try to find another place for my life-type content blog.

We are considering using static generators such as ruhoh and hosting them on GitHub pages. However, it is not good to post a blog on GitHub. Therefore, it may be better to simply put it on your own air, and nginx is a little slow, because it is completely static, and even the ruby environment does not need to be installed. Haha, the record filing is much more convenient. All servers are saved.
But it may be too troublesome. It's really easy, so there's another option: Go to BSP, Netease blog Sohu blog, lofter or something. Let's take a look.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.