How can I automatically save and index data from an internet database at a specified interval
古いコメントを表示
I want to be able to read source code from a URL and extract variable values (such as commodity prices or stocks) at a specified interval automatically (hourly or daily). The extracted values would then, ideally be appended to a matrix of value so I can look at fluctuations over time. Is this possible in MATLAB?
If so, is it elegant?
How would you suggest approaching the problem?
If not, is there another language I should consider? For what benefits?
Thanks.
採用された回答
その他の回答 (1 件)
Sven
2013 年 3 月 10 日
0 投票
MATLAB is reasonably well suited to do all the things you're looking for.
Check out, for example, the Trendy section of the MATLAB community website. It's an entire section specifically dedicated to periodic scraping of web URL data, that is subsequently presented to the user in some form showing changes in this data over time. The Trendy site was originally set up for daily scraping, but there's nothing stopping you from setting your own timing. I'm not suggesting that you should implement your solution as a Trendy entry, but you may benefit from checking out the source code of some of the entries.
A couple of points I would make:
- The latest version of MATLAB actually has a financial toolbox which may contain some of the functionality you're planning on writing yourself.
- There may already be various data sources set up that do the dirty work (scraping of historic data) for you. It might be more "elegant" to simply load from those data sources whenever you want to display your results.
- The periodic part of your implementation is something that might take some thought. One way would be to simply have a computer with MATLAB which runs all day, all night, on an infinite loop with a 1-hour pause() command. Another way might be to have some system event (say, a kron job) occur every hour which silently starts MATLAB, runs the short script which scrapes data, and then closes MATLAB again. I guess this would all depend on what you specifically want/need for this application to do.
Hope that could help in answering your question.
カテゴリ
ヘルプ センター および File Exchange で Call Python from MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!