做一个asp的企业网站大约需要多少钱
准备接点私话,给别人做一个企业网站,大体的功能就像这个http://www.szlmdg.com/企业网站的功能,个人做,应该开价多少?
最满意答案
好吧,因为没有人回答,我决定开始讨论Google Calendar API的非PHP文档,特别是.NET的东西,只是在原始协议中。 你不知道吗...
如果您转到.NET文档,它会提到很酷的新功能,特别是如何为经过身份验证的用户创建新的非主日历以及如何将事件添加到非主日历。
当然,这个文档在PHP领域没有出现,并且似乎没有一对一的关联。 为了创建新的日历,我首先尝试了一些明显的东西,然后,破产,尝试了一些不那么明显的工作。 我想我会分享一下,因为无线电沉默的原因是没有人知道答案,但肯定会。
创建新日历:
这有两个关键:
您必须使用相同的方法来添加日历事件,即
insertEvent()
您必须在方法中设置帖子网址,否则这些网址会转到默认Feed网址。
本示例检查App日历是否已经存在,如果没有,创建它:
//Standard creation of the HTTP client $gdataCal = new Zend_Gdata_Calendar($client); //Get list of existing calendars $calFeed = $gdataCal->getCalendarListFeed(); //Set this to true by default, only gets set to false if calendar is found $noAppCal = true; //Loop through calendars and check name which is ->title->text foreach ($calFeed as $calendar) { if($calendar -> title -> text == "App Calendar") { $noAppCal = false; } } //If name not found, create the calendar if($noAppCal) { // I actually had to guess this method based on Google API's "magic" factory $appCal = $gdataCal -> newListEntry(); // I only set the title, other options like color are available. $appCal -> title = $gdataCal-> newTitle("App Calendar"); //This is the right URL to post to for new calendars... //Notice that the user's info is nowhere in there $own_cal = "http://www.google.com/calendar/feeds/default/owncalendars/full"; //And here's the payoff. //Use the insertEvent method, set the second optional var to the right URL $gdataCal->insertEvent($appCal, $own_cal); }
在那里你有它。 下一个目标是将事件插入该日历,而不是默认日历。
将事件添加到非主日历
您可能会猜到的简单部分是,您需要再次设置该可选URL,例如:
insertEvent($newEvent, $calURL)
,棘手的部分是获取日历的URL。 与“拥有的日历”路径不同,特定的日历不仅具有用户特定的信息,还具有某种类型的哈希查找ID。代码如下:
//Set up that loop again to find the new calendar: $calFeed = $gdataCal->getCalendarListFeed(); foreach ($calFeed as $calendar) { if($calendar->title->text == "App Calendar") //This is the money, you need to use '->content-src' //Anything else and you have to manipulate it to get it right. $appCalUrl = $calendar->content->src; } //.......... Some Assumed MySQL query and results ............. while ($event = $result->fetch_assoc()) { $title = $event['description']; //Quick heads up //This is a handy way of getting the date/time in one expression. $eventStart = date('Y-m-d\TH:i:sP', strtotime($event['start'])); $eventEnd = date('Y-m-d\TH:i:sP', strtotime($event['end'])); $newEvent = $gdataCal->newEventEntry(); $newEvent->title = $gdataCal->newTitle($title); $when = $gdataCal->newWhen(); $when->startTime = $eventStart; $when->endTime = $eventEnd; $newEvent->when = array($when); //And at last, the insert is set to the calendar URL found above $createdEvent = $gdataCal->insertEvent($newEvent, $appCalUrl); } echo "<p>".$result->num_rows." added to your Google calendar.</p>";
感谢任何阅读过我的问题并对此做过任何思考的人。 如果有人知道一种方法来收紧上面的代码(也许我不需要两个循环?),我很想获得反馈。
Well since no one answered, I decided to start poking around at the non-PHP documentation for the Google Calendar API, specifically at the .NET stuff and just a bit in the raw protocol. And wouldn't you know it...
If you go to the .NET documentation it mentions cool new features, specifically how to create new non-primary calendars for authenticated users and how to add events to non-primary calendars.
Of course, this documentation shows up nowhere in the PHP area, and there does not seem to be a one-to-one correlation. For the creating of the new calendar, I tried some obvious stuff first, then, going for broke, tried something not-so-obvious that worked. I thought I'd share in case the reason for the radio silence was that no one knew the answer but sure would like to.
To create a new calendar:
There are two keys to this:
You have to use the same method for adding calendar events, which is
insertEvent()
You have to set the post URL in the method, which otherwise goes to the default feed URL.
This example checks to see if the App Calendar already exists and if not, creates it:
//Standard creation of the HTTP client $gdataCal = new Zend_Gdata_Calendar($client); //Get list of existing calendars $calFeed = $gdataCal->getCalendarListFeed(); //Set this to true by default, only gets set to false if calendar is found $noAppCal = true; //Loop through calendars and check name which is ->title->text foreach ($calFeed as $calendar) { if($calendar -> title -> text == "App Calendar") { $noAppCal = false; } } //If name not found, create the calendar if($noAppCal) { // I actually had to guess this method based on Google API's "magic" factory $appCal = $gdataCal -> newListEntry(); // I only set the title, other options like color are available. $appCal -> title = $gdataCal-> newTitle("App Calendar"); //This is the right URL to post to for new calendars... //Notice that the user's info is nowhere in there $own_cal = "http://www.google.com/calendar/feeds/default/owncalendars/full"; //And here's the payoff. //Use the insertEvent method, set the second optional var to the right URL $gdataCal->insertEvent($appCal, $own_cal); }
And there you have it. The next goal is to insert events to that calendar, not to the default calendar.
Adding events to non-primary calendar
The easy part that you can probably guess is that you need to set that optional URL again, like such :
insertEvent($newEvent, $calURL)
, the tricky part is getting the calendar's URL. Unlike the "owned calendars" path, specific calendars not only have user-specifc info in it, they have some kind of hash-lookin' ID in there, too.Here's the code:
//Set up that loop again to find the new calendar: $calFeed = $gdataCal->getCalendarListFeed(); foreach ($calFeed as $calendar) { if($calendar->title->text == "App Calendar") //This is the money, you need to use '->content-src' //Anything else and you have to manipulate it to get it right. $appCalUrl = $calendar->content->src; } //.......... Some Assumed MySQL query and results ............. while ($event = $result->fetch_assoc()) { $title = $event['description']; //Quick heads up //This is a handy way of getting the date/time in one expression. $eventStart = date('Y-m-d\TH:i:sP', strtotime($event['start'])); $eventEnd = date('Y-m-d\TH:i:sP', strtotime($event['end'])); $newEvent = $gdataCal->newEventEntry(); $newEvent->title = $gdataCal->newTitle($title); $when = $gdataCal->newWhen(); $when->startTime = $eventStart; $when->endTime = $eventEnd; $newEvent->when = array($when); //And at last, the insert is set to the calendar URL found above $createdEvent = $gdataCal->insertEvent($newEvent, $appCalUrl); } echo "<p>".$result->num_rows." added to your Google calendar.</p>";
Thanks to anyone who read my question and did any thinking on it. If anyone knows of a way to tighten the above code up (maybe I don't need two loops?) I'd love to get feedback.
相关问答
更多-
好吧,因为没有人回答,我决定开始讨论Google Calendar API的非PHP文档,特别是.NET的东西,只是在原始协议中。 你不知道吗... 如果您转到.NET文档,它会提到很酷的新功能,特别是如何为经过身份验证的用户创建新的非主日历以及如何将事件添加到非主日历。 当然,这个文档在PHP领域没有出现,并且似乎没有一对一的关联。 为了创建新的日历,我首先尝试了一些明显的东西,然后,破产,尝试了一些不那么明显的工作。 我想我会分享一下,因为无线电沉默的原因是没有人知道答案,但肯定会。 创建新日历: 这有 ...
-
Google支持人员表示无法模仿群组用户。 我必须通过冒充某些群组用户并与群组共享来创建日历。 Google support says that it is not possible to impersonate group user. I have to create calendar by impersonating some group user and share it with a group.
-
避免使用Google Calendar API在人口日历中添加实际事件?(Avoid Google Calendar API adding an actual event in peoples calendars?)[2023-08-07]
听起来您的应用程序需要自己的日历 - 所以创建一个(请参阅Calendars.insert以了解如何以编程方式执行此操作)。 您是否需要整个应用程序的单个日历,无论用户是谁(在这种情况下您可能希望使用服务帐户身份验证,并创建与服务帐户关联的单个日历)或每个用户额外的日历(在这种情况下)您将使用用户身份验证并在其帐户中创建另一个日历)取决于您的应用程序需求。 值得注意的是,如果您在用户的帐户中创建日历,他们几乎肯定可以通过Web UI访问它。 同样,这是否是一个问题取决于应用程序。 It sounds lik ... -
将此导入com.google.api.services.calendar.Calendar替换为com.google.api.services.calendar.model.Calendar。 Replace this import com.google.api.services.calendar.Calendar with com.google.api.services.calendar.model.Calendar.
-
查看完整的谷歌日历API https://developers.google.com/google-apps/calendar/v1/developers_guide_javascript Checkout the full google calendar api https://developers.google.com/google-apps/calendar/v1/developers_guide_javascript
-
显然,可以使用https://developers.google.com/google-apps/calendar/v3/reference/calendarList/list执行此操作。 我不确定为什么它在我第一次尝试时不起作用... Apparently one can do this using https://developers.google.com/google-apps/calendar/v3/reference/calendarList/list. Not sure why it didn' ...
-
Google日历API要求“管理您的联系人”权限?(Google calendar API asking for “manage your contacts” permission?)[2023-08-25]
看起来这可能是因为谷歌希望接收用户日历上发现的人,以查看他们是否是联系人,以便他们可以提供关于该人或事件的更多信息(因为谷歌连接字面上的一切)。 我建议您查看文档以获取更多信息,但我假设您将在任何Google日历请求中锁定此权限。 It seems this may be happening because Google wants to relay people found on a users calendar to see if they are a contact so that they can ... -
primary是文档指定的唯一特殊值。 如果Calendar API支持这样的特殊值,则不会公开支持,并且可以随时删除或更改。 您最好的选择是使用calendar.calendarList.list方法获取所有用户日历的列表,并列出每个日历的事件。 primary is the only special value that the documentation specifies. If the Calendar API does support such a special value, it is no ...
-
无法使用日历ID通过API获取Google日历名称(Cannot fetch the Google Calendar name through API using Calendar ID)[2022-06-24]
要获取有关日历的信息,请使用 Calendar.get返回日历的元数据。 请求(注释访问令牌): 获取https://www.googleapis.com/calendar/v3/calendars/en.indian#holiday@group.v.calendar.google.com?access_token=youraccesstoken 响应 { "kind": "calendar#calendar", "etag": "\"fBXC91rAg76NkSpaCdEoUEir1ww/pR1e1Z ... -
是。 只要日历活动是在此处提到的Google课堂中创建的,您就可以从Google课堂中获取日历活动。 演示: 去上课。 转到“关于”部分,然后点击“在Google日历中打开”。 现在它将打开Google日历。 创建一个示例事件。 转到Calendar.list Try-It并在“Fields”文本框(Execute按钮上方)中,检查所有参数。 执行。 您会在Google日历中看到所有事件,包括属于Google课堂的事件。 Yes. You can fetch the calendar events from ...