首页 \ 问答 \ Web应用程序的自动网站截图?(Automatic website screenshots for Web app?)

Web应用程序的自动网站截图?(Automatic website screenshots for Web app?)

有没有办法使用PHP或Ruby on Rails在Web应用程序中自动截取网页(通过指定其URL)? 也许使用插件或一些外部REST服务。

我研究了很多,似乎没有什么比这更合适了( http://www.binarymoon.co.uk/2010/02/automated-take-screenshots-website-free/ )但我怀疑Wordpress会不会让我垃圾邮件他们的服务器的东西不是Wordpress相关的。

我想将它用于我自己的网络应用程序,所以我不确定其法律含义。这对我自己实施起来有多难? 它需要什么?

谢谢!


Is there a way to take automatic screenshots of a web page (by specifying its URL) in a web app using PHP or Ruby on Rails? Perhaps using a plugin or some external REST service.

I've researched a lot, and nothing seems to fit except something like this (http://www.binarymoon.co.uk/2010/02/automated-take-screenshots-website-free/) but I doubt Wordpress would just let me spam their servers for something not Wordpress related.

I'd like to use it for my own web application so I'm not sure of the legal implications..how hard is this to implement myself? What does it entail?

Thanks!


原文:https://stackoverflow.com/questions/3248773
更新时间:2022-12-15 06:12

最满意答案

如果您使用iCal4j,则可以创建计划对象以按如下方式对事件进行排序:

PriorityQueue<VEvent> plan = new PriorityQueue<VEvent>(10, new Comparator<VEvent>() {    
    @Override
    public int compare(VEvent e1, VEvent e2)
    {
        Date d1 = e1.getStartDate().getDate();
        Date d2 = e2.getStartDate().getDate();
        return d1.compareTo(d2);
    }
});

If you use iCal4j, you can create your plan object to sort your events as following:

PriorityQueue<VEvent> plan = new PriorityQueue<VEvent>(10, new Comparator<VEvent>() {    
    @Override
    public int compare(VEvent e1, VEvent e2)
    {
        Date d1 = e1.getStartDate().getDate();
        Date d2 = e2.getStartDate().getDate();
        return d1.compareTo(d2);
    }
});

相关问答

更多
  • 这是dday当前版本中的一个错误,将在未来版本中修复 谷歌重复任务直到时间错误 This is a bug in the current version of dday ical and will be fixed in future versions Google Repeating Task Until Time Bug
  • 今天我一直在努力,发现你可以按日期过滤(至少在雪豹上)。 所以 tell application "iCal" set out to "" set todaysDate to current date set time of todaysDate to 0 repeat with c in (every calendar) set theEvents to (every event of c whose start date ≥ todaysDate) ...
  • 首先,尝试从客户端查看标头,以确保标头没有被损坏或丢失。 您可以使用curl --head然后使用URL来查看同一台计算机上的客户端将接收的完整标头。 (如果要更改基于cookie或代理信息的行为,您可能希望使用该特定客户端的插件或开发人员工具来查看标头信息。) 其次,您的UID在整个宇宙中并不是唯一的。 那些UID可以在其他地方复制。 一种常见做法是将您自己的唯一主机名附加到UID,以确保它们是唯一的。 最后,您没有在Google日历和iCal中提及Feed的失败方式。 是否简单地忽略了Feed,就好像它 ...
  • 在iCalendar中这样做的正确方法是使用他们所谓的“浮动时间”,它完全符合你的要求,而且你的确只需要从时间中删除Z. 如果这不适用于谷歌日历,那么这意味着他们不支持浮动时间,那么不幸的答案就是'这是不可能的'。 The correct way in iCalendar to do this, is by using what they call 'floating time' it does exactly what you want, and you indeed only have to remov ...
  • 这是我要做的: sub date2ical { my $date = shift; Date::ICal->new( ical => UnixDate($date, '%QT%H%M%S'), # %Q means %Y%m%d offset => UnixDate($date, '%z')); } # end date2ical # Usage: my $ical = date2ical(ParseDateString('today')); 这应该正 ...
  • 刚想通了。 像这样重做控制器: require 'icalendar' require 'net/http' uri = URI('https://calendar.google.com/calendar/ical/7d9i7je5o16ec6cje702gvlih0hqa9um%40import.calendar.google.com/public/basic.ics') calendar = Net::HTTP.get(uri) cals = Icalendar::Calend ...
  • 如果您使用iCal4j,则可以创建计划对象以按如下方式对事件进行排序: PriorityQueue plan = new PriorityQueue(10, new Comparator() { @Override public int compare(VEvent e1, VEvent e2) { Date d1 = e1.getStartDate().getDate(); Date d2 = ...
  • 显然,由于date + 12AM是date之后的0个刻度,iCal.net假设您在创建CalDateTime实例时指的是date (没有时间)。 如果您查看new CalDateTime(TimeZoneInfo.ConvertTimeFromUtc(start,TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time")), "America/New_York")上的对象属性,其中start是在上午12点,您可以看到HasTime为false 。 ...
  • 请参阅RFC5545,您需要添加一个vtimezone组件来将TZID引用到它 参数名称: TZID 当指定DATE-TIME或TIME值类型且值既不是UTC也不是UTC时,必须在“DTSTART”,“DTEND”,“DUE”,“EXDATE”和“RDATE”属性中指定此参数。 “漂浮”的时间。 如果未在iCalendar对象中包含和遵循VTIMEZONE定义,则可能导致对任何给定位置的本地时间的理解不一致。 BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Microsoft C ...
  • 我很确定您会看到此行为,因为您的VTIMEZONE未指定任何时区偏移(有效的VTIMEZONE对象必须至少包含一个STANDARD或DAYLIGHT组件)。 尝试包含有效的VTIMEZONE (请参阅RFC 5545 )或以UTC VTIMEZONE指定日期时间。 通过省略任何时间信息,可以选择让您的活动“全天”: DTSTART;VALUE=DATE:20160303 DTEND;VALUE=DATE:20160304 I'm pretty sure that you see this behavior ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)