The new version of "Little intelligence" was released on schedule

Source: Internet
Author: User
After a week of hard work, the new version of little intelligence was finally completed on schedule.

In this version, apart from the large transformation of the underlying object model, more importantly, it began to support the software's function of Automatically Obtaining stock data from the Internet. Currently, you can obtain the transaction information of the current day from Yahoo! and Sina, as well as historical data from analyst websites.

The stock data of Yahoo and Sina is provided in the form of HTML pages, so my program only needs to download the corresponding page, in addition, you can use a regular expression to match each item of stock information. For example, the following code is used to extract the data items of each stock from the Sina page: qregexp rx ("<tr bgcolor = (? :/S +) align = center> <a name = (/S +)> </a> (. + )(? = </Tr> )");
Rx. setminimal (true );
Int Pos = 0;
While (Pos = Rx. indexin (mreceiveddata, POS ))! =-1 )...{
Processforonestock (RX. CAP (2 ));
Pos + = Rx. matchedlength ();
}

The daily data provided by the analyst's website is a data file compressed into a zip file. I used a third-party ZIP file parsing class to extract the original file and then read the binary file, to obtain the corresponding stock data, and now it can achieve stable extraction of its data.

In the next step, in version 0.03 of "Little intelligence", the function of automatically updating data at regular intervals will be supported, and the current K-line chart display screen will be transformed to improve its efficiency.

Http://code.google.com/p/tcstock

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.