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
最满意答案
如果您使用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 ...
-
如何使用Date :: Manip创建Date :: ICal可用的日期?(How do I use Date::Manip to create a date usable by Date::ICal?)[2021-07-01]
这是我要做的: 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')); 这应该正 ... -
Ruby / Rails:如何通过dtstart对icalendar文件数据进行排序?(Ruby/Rails: How to sort icalendar file data by dtstart?)[2023-01-25]
刚想通了。 像这样重做控制器: 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 。 ...
-
发送此iCal邀请时如何调整时区信息?(How do I adjust the timezone information when sending this iCal invite?)[2023-09-03]
请参阅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 ...