我需要打开一个新的谷歌会议室,并发送它。我不能使用标准的"份额;按钮。我需要获取最终的网址。我不能用curl来理解(这不是一个正常的重定向(。我的想法是,我需要在后台或同一页面中打开一个请求/链接,等待一秒钟,然后抓住链接,然后我可以发布页面,用户可以进入。
你知道什么能帮我的吗?
编辑:是的,我错过了告诉你,我需要通过点击生成一个房间,并从代码中获取url。一般来说,我应该用谷歌日历API来做这个,但在这种情况下我做不到。
我使用谷歌日历API。我为我的组织制作了一个网络应用程序,从一个表单(带有用户信息发送到会议链接(中,用谷歌会议室(从谷歌loggedin用户帐户(制作一个谷歌日历活动,捕捉链接并通过smsGateway发送。
function FormForMeet (Args) {
// get calendar name, if it already exists
var meetsCalendar = CalendarApp.getCalendarsByName ('CalendarName');
Logger.log (meetsCalendar.length)
if (meetsCalendar.length> = 1) {
// if some calendar be found, it catch the first, obviously here you can use some differet method. I had choose this because I don't expect to find more than 1
var calendar = meetsCalendar [0] .getId ();
}
else
{
// If miss, create new one.
var calendar = CalendarApp.createCalendar ('CalendarName', {summary: 'descrip Calendar',
// set a color of calendar label :D
color: CalendarApp.Color.PURPLE});
calendar = calendar.getId ();
}
// Call function to create meet
var LinkMeet = CreateConference_ (calendar);
// here you can use what you want for send Args + LinkMeet);
// if you want return link
return LinkMeet;
}
// Function to create Conference. You can obviously use the code up without make a new function.
function CreateConference_ (calendarId) {
// Custom of event, here I created the conferences according to my needs (now, with 1 h / conference)
var now = new Date ();
var start = new Date (now.getTime ()). toISOString ();
var end = new Date (now.getTime () + (1 * 60 * 60 * 1000)). toISOString ();
// generate random string to request
var rdmreqId = genStrg ();
var event = {
"end": {
"dateTime": end
},
"start": {
"dateTime": start
},
"summary": "conferenceName",
"conferenceData": {
"createRequest": {
"conferenceSolutionKey": {
"type": "hangoutsMeet"
},
"requestId": rdmreqId
}
}
};
// insert event in calendar
event = Calendar.Events.insert (event, calendarId, {
"conferenceDataVersion": 1});
// if use the function you can return the link to send
return event.hangoutLink
}
// random strind
function genStrg () {
var data = "something";
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789! @ # $% & <> * -";
for (var j = 2; j <= data.length; j ++) {
text = ""; // Reset text to empty string
for (var i = 0; i <possible.length; i ++) {
text + = possible.charAt (Math.floor (Math.random () * possible.length));
}
return text;
}
}
所有谷歌会议链接看起来都是这样的:https://meet.google.com/abc-defg-hij
您应该可以从浏览器页面复制并粘贴此链接。如果有人进入此链接,他们将被带到会议大厅,可以随时进入。
如果你因为某种原因无法访问此链接,比如你在手机上,你必须将你的会面代码(abc-defg-hij
(放在前面提到的url的末尾。
edit:如果你在手机上,你实际上可以通过进入会议大厅并向下滚动直到到达"来找到链接;加入信息";。下面应该有会议链接和通过电话加入的号码。