doulianqi3870 2014-03-12 09:51
浏览 9

Chrome扩展程序中的已删除数据

I am looking to scrape some elements from various websites that will all return an image and a description. Users of the extension will then select which websites they are interested in and a selection of images and descriptions from those sites will be displayed on their new tab page in masonry format.

The problem is that this data updates frequently, maybe a few times a day with elements appearing and disappearing.

The way I see it I have two options:

  1. Scrape the data each time a user opens a new tab via an AJAX request, though I expect this will be incredibly slow.

  2. Periodically scrape the data, store it in a mySQL database and fetch it from there.

Are either of these the best option, or is there something else I should consider? Perhaps there's a way to do this in the background so there's no delay when the user opens the new tab?

Do let me know if I've been unclear.

  • 写回答

1条回答 默认 最新

  • doubairan4213 2014-03-12 11:02
    关注

    I think you could have an asynchronous app that will display the data step by step, when it is available: you bind an object to the UI, when that object is extended/modified then the UI is modified as well in the same time (that's known as double data binding). You could use AngularJS and other big frameworks or little ones like vue.js.

    I wouldn't bet in mysql in a browser, but on other forms of storage maybe.

    评论

报告相同问题?

悬赏问题

  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类