dpdhnd3577 2015-07-30 18:43
浏览 37

在Google或文本文件中保存Google图片链接及其关键字

I need to parse Google Images for a specified keyword(s) and retrieve image links, which I can do with PHP simple dom parser, and can retrieve a few image links per call. Google Images API is limited to 100 calls right now. Now, I need to save those image links for a "keyword" so that next time when I need images for that keyword, my script first looks for whether keywords and its related images (i.e. URL's) are already stored in my system and whether there is any need to call Google.

What would the most efficient way to store that keyword and images (i.e. db or simple text files)?

If it is mySQL then what does its schema look like?

Can I store image links in a text file where the file name is keyword?

  • 写回答

2条回答 默认 最新

  • dou12754 2015-07-30 18:52
    关注

    I would suggest using mysql, choosing it gives u flexibility, speed and easy access to your data. Just put info about your images in one table, something like:

    id | name | keyword | path | creTime | size | ext ( and any other that u would need )
    

    Then you can just pull any number of images by Keyword, like "water", "views", or something.

    I would probably make two tables of it, changing keyword for keywordId. Then create foreign key to Keyword_data. Now you have relation One ( keywordId ) from Images_data to Many ( id ) keyword_data.

    id | keyword | description | ( anything else)
    

    That way you can have multiple keywords for any image group, as it would be more flexible.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?