בעיה | בעיה בגוגל סקריפט
-
יש לי קובץ סקריפט בגוגל סקריפט (את האמת ביקשתי מבינה מלאכותית שתבנה לי אותו ) וכל פעם שאני מכניס אותו לגוגל סקריפט מופיע סימן כזה ~ אדום בסוף השורה האחרונה שאי אפשר למחוק אותו וכל פעם שאני מנסה לשמור את הקובץ הוא לא נותן וכותב "שגיאת תחביר: SyntaxError: Unexpected end of input שורה: 28 קובץ: קוד.gs "
אני אמנם לא מבין באמת כלום בכתיבת קוד אבל אולי לחברים פה יהיה פיתרון -
יש לי קובץ סקריפט בגוגל סקריפט (את האמת ביקשתי מבינה מלאכותית שתבנה לי אותו ) וכל פעם שאני מכניס אותו לגוגל סקריפט מופיע סימן כזה ~ אדום בסוף השורה האחרונה שאי אפשר למחוק אותו וכל פעם שאני מנסה לשמור את הקובץ הוא לא נותן וכותב "שגיאת תחביר: SyntaxError: Unexpected end of input שורה: 28 קובץ: קוד.gs "
אני אמנם לא מבין באמת כלום בכתיבת קוד אבל אולי לחברים פה יהיה פיתרון -
יש לי קובץ סקריפט בגוגל סקריפט (את האמת ביקשתי מבינה מלאכותית שתבנה לי אותו ) וכל פעם שאני מכניס אותו לגוגל סקריפט מופיע סימן כזה ~ אדום בסוף השורה האחרונה שאי אפשר למחוק אותו וכל פעם שאני מנסה לשמור את הקובץ הוא לא נותן וכותב "שגיאת תחביר: SyntaxError: Unexpected end of input שורה: 28 קובץ: קוד.gs "
אני אמנם לא מבין באמת כלום בכתיבת קוד אבל אולי לחברים פה יהיה פיתרון@t-k אני יכול לשער שביקשת את הבקשה שלך בעברית. אם תבקש אותה באנגלית (על ידי תרגום בגוגל טרנסלייט למשל), זה יכול לחסוך כמה בעיות בסגנון שהזכיר כאן @אביי
(למרות שבדר"כ זה לא ממש משנה עבור תכנות, אלא רק עבור בקשות של סיפורים, שירים ובקשות אחרות)
-
@t-k אני יכול לשער שביקשת את הבקשה שלך בעברית. אם תבקש אותה באנגלית (על ידי תרגום בגוגל טרנסלייט למשל), זה יכול לחסוך כמה בעיות בסגנון שהזכיר כאן @אביי
(למרות שבדר"כ זה לא ממש משנה עבור תכנות, אלא רק עבור בקשות של סיפורים, שירים ובקשות אחרות)
-
@t-k אם תביא את הקוד אולי נוכל לעזור לך...
אגב, הבינה המלאכותית אלופה בליצור קוד שכתוב נכון אך מלא בפונקציות שלא קיימות...בגדול השגיאה הזו אומרת שיש לך תו לא תקין, או שחסר לך סוגר וכדו'
@אביי הסקריפט שקיבלתי
`() {
var DAYS_OF_WEEK = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday"];// Check which day of the week it is
var today = new Date();
var day = DAYS_OF_WEEK[today.getDay()];// Get the last file of the day's radio program
var radioProgramUrl = "https://103fm.maariv.co.il/program/י %D7 %A0%D7 %95%D7%9F-%D7%9E%D7%92%D7%9C-%D7%91%D7%9F-%D7%9B%D7%A1%D7%A4%D7% 99% D7%AA";
var lastFile = getLastFile(radioProgramUrl);// Get the user details for the Torah Bank
var userName = "";
var password = "";// Send the file to the Torah Bank
var loginUrl = "https://www.kolhalashon.com/Membership/KhlLogin.aspx?ReturnUrl=%2FToraBank%2FToraBankMain.aspx%3FLang%3DHebrew&Lang=Hebrew";
var torahBankUrl = "https://www.kolhalashon.com/ToraBank/ToraBankMain.aspx?Lang=Hebrew";// Set the trigger to run the script at 12 noon every day
ScriptApp.newTrigger("sendFileToTorahBank")
.timeBased()
.onWeekDay(DayOfWeek.MONDAY)
.atHour(12)
.create();// Function
` -
@אביי הסקריפט שקיבלתי
`() {
var DAYS_OF_WEEK = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday"];// Check which day of the week it is
var today = new Date();
var day = DAYS_OF_WEEK[today.getDay()];// Get the last file of the day's radio program
var radioProgramUrl = "https://103fm.maariv.co.il/program/י %D7 %A0%D7 %95%D7%9F-%D7%9E%D7%92%D7%9C-%D7%91%D7%9F-%D7%9B%D7%A1%D7%A4%D7% 99% D7%AA";
var lastFile = getLastFile(radioProgramUrl);// Get the user details for the Torah Bank
var userName = "";
var password = "";// Send the file to the Torah Bank
var loginUrl = "https://www.kolhalashon.com/Membership/KhlLogin.aspx?ReturnUrl=%2FToraBank%2FToraBankMain.aspx%3FLang%3DHebrew&Lang=Hebrew";
var torahBankUrl = "https://www.kolhalashon.com/ToraBank/ToraBankMain.aspx?Lang=Hebrew";// Set the trigger to run the script at 12 noon every day
ScriptApp.newTrigger("sendFileToTorahBank")
.timeBased()
.onWeekDay(DayOfWeek.MONDAY)
.atHour(12)
.create();// Function
`@t-k זה ממש לא אמור לעבוד..
נסה את זה כך, לא בדקתי אם זה עובד, ואם זה עושה בכלל את מה שרצית כי אין לי זמן...
שים לב שבשורה 9 בקישור יש לך אות "י" בעברית...
function myfunction() { var DAYS_OF_WEEK = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday"]; // Check which day of the week it is var today = new Date(); var day = DAYS_OF_WEEK[today.getDay()]; // Get the last file of the day's radio program var radioProgramUrl = "https://103fm.maariv.co.il/program/י %D7 %A0%D7 %95%D7%9F-%D7%9E%D7%92%D7%9C-%D7%91%D7%9F-%D7%9B%D7%A1%D7%A4%D7% 99% D7%AA"; var lastFile = getLastFile(radioProgramUrl); // Get the user details for the Torah Bank var userName = ""; var password = ""; // Send the file to the Torah Bank var loginUrl = "https://www.kolhalashon.com/Membership/KhlLogin.aspx?ReturnUrl=%2FToraBank%2FToraBankMain.aspx%3FLang%3DHebrew&Lang=Hebrew"; var torahBankUrl = "https://www.kolhalashon.com/ToraBank/ToraBankMain.aspx?Lang=Hebrew"; // Set the trigger to run the script at 12 noon every day ScriptApp.newTrigger("sendFileToTorahBank") .timeBased() .onWeekDay(DayOfWeek.MONDAY) .atHour(12) .create(); }
-
@אביי הסקריפט שקיבלתי
`() {
var DAYS_OF_WEEK = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday"];// Check which day of the week it is
var today = new Date();
var day = DAYS_OF_WEEK[today.getDay()];// Get the last file of the day's radio program
var radioProgramUrl = "https://103fm.maariv.co.il/program/י %D7 %A0%D7 %95%D7%9F-%D7%9E%D7%92%D7%9C-%D7%91%D7%9F-%D7%9B%D7%A1%D7%A4%D7% 99% D7%AA";
var lastFile = getLastFile(radioProgramUrl);// Get the user details for the Torah Bank
var userName = "";
var password = "";// Send the file to the Torah Bank
var loginUrl = "https://www.kolhalashon.com/Membership/KhlLogin.aspx?ReturnUrl=%2FToraBank%2FToraBankMain.aspx%3FLang%3DHebrew&Lang=Hebrew";
var torahBankUrl = "https://www.kolhalashon.com/ToraBank/ToraBankMain.aspx?Lang=Hebrew";// Set the trigger to run the script at 12 noon every day
ScriptApp.newTrigger("sendFileToTorahBank")
.timeBased()
.onWeekDay(DayOfWeek.MONDAY)
.atHour(12)
.create();// Function
` -
@t-k זה ממש לא אמור לעבוד..
נסה את זה כך, לא בדקתי אם זה עובד, ואם זה עושה בכלל את מה שרצית כי אין לי זמן...
שים לב שבשורה 9 בקישור יש לך אות "י" בעברית...
function myfunction() { var DAYS_OF_WEEK = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday"]; // Check which day of the week it is var today = new Date(); var day = DAYS_OF_WEEK[today.getDay()]; // Get the last file of the day's radio program var radioProgramUrl = "https://103fm.maariv.co.il/program/י %D7 %A0%D7 %95%D7%9F-%D7%9E%D7%92%D7%9C-%D7%91%D7%9F-%D7%9B%D7%A1%D7%A4%D7% 99% D7%AA"; var lastFile = getLastFile(radioProgramUrl); // Get the user details for the Torah Bank var userName = ""; var password = ""; // Send the file to the Torah Bank var loginUrl = "https://www.kolhalashon.com/Membership/KhlLogin.aspx?ReturnUrl=%2FToraBank%2FToraBankMain.aspx%3FLang%3DHebrew&Lang=Hebrew"; var torahBankUrl = "https://www.kolhalashon.com/ToraBank/ToraBankMain.aspx?Lang=Hebrew"; // Set the trigger to run the script at 12 noon every day ScriptApp.newTrigger("sendFileToTorahBank") .timeBased() .onWeekDay(DayOfWeek.MONDAY) .atHour(12) .create(); }
@אביי זה לא נמצא בסקריפט האות י כנראה נכנס לי לפוסט כשהנסתי את הקוד הקוד מחדש הוא
var DAYS_OF_WEEK = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday"]; // Check which day of the week it is var today = new Date(); var day = DAYS_OF_WEEK[today.getDay()]; // Get the last file of the day's radio program var radioProgramUrl = "https://103fm.maariv.co.il/program/%D7%99 %D7 %A0%D7 %95%D7%9F-%D7%9E%D7%92%D7%9C-%D7%91%D7%9F-%D7%9B%D7%A1%D7%A4%D7% 99% D7%AA"; var lastFile = getLastFile(radioProgramUrl); // Get the user details for the Torah Bank var userName = "******"; var password = "******"; // Send the file to the Torah Bank var loginUrl = "https://www.kolhalashon.com/Membership/KhlLogin.aspx?ReturnUrl=%2fToraBank%2fToraBankMain.aspx%3fLang%3dHebrew&Lang=Hebrew"; var torahBankUrl = "https://www.kolhalashon.com/ToraBank/ToraBankMain.aspx?Lang=Hebrew"; // Set the trigger to run the script at 12 noon every day ScriptApp.newTrigger("sendFileToTorahBank") .timeBased() .onWeekDay(DayOfWeek.MONDAY) .atHour(12) .create(); // Function```
-
@t-k בא נאמר שכעקרון אתה אמור לתקשר עם הצ'אט... הוי אומר שתכתוב לו שהייתה שגיאה ותעתיק את תוכן השגיאה להתכתבות אתו
-
@t-k זה ממש לא אמור לעבוד..
נסה את זה כך, לא בדקתי אם זה עובד, ואם זה עושה בכלל את מה שרצית כי אין לי זמן...
שים לב שבשורה 9 בקישור יש לך אות "י" בעברית...
function myfunction() { var DAYS_OF_WEEK = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday"]; // Check which day of the week it is var today = new Date(); var day = DAYS_OF_WEEK[today.getDay()]; // Get the last file of the day's radio program var radioProgramUrl = "https://103fm.maariv.co.il/program/י %D7 %A0%D7 %95%D7%9F-%D7%9E%D7%92%D7%9C-%D7%91%D7%9F-%D7%9B%D7%A1%D7%A4%D7% 99% D7%AA"; var lastFile = getLastFile(radioProgramUrl); // Get the user details for the Torah Bank var userName = ""; var password = ""; // Send the file to the Torah Bank var loginUrl = "https://www.kolhalashon.com/Membership/KhlLogin.aspx?ReturnUrl=%2FToraBank%2FToraBankMain.aspx%3FLang%3DHebrew&Lang=Hebrew"; var torahBankUrl = "https://www.kolhalashon.com/ToraBank/ToraBankMain.aspx?Lang=Hebrew"; // Set the trigger to run the script at 12 noon every day ScriptApp.newTrigger("sendFileToTorahBank") .timeBased() .onWeekDay(DayOfWeek.MONDAY) .atHour(12) .create(); }
-
שלחתי לו את השאלה והוא הגיב לי את התגובה הבאה
השאלה איפה לשים את זה ובמקום מהThe problem with this script is that the trigger is set incorrectly. Instead of setting the trigger to run the script on a Monday, it should be set to run it every day of the week. To do this, you can change the code as follows:
ScriptApp.newTrigger("sendFileToTorahBank") .timeBased() .onWeekDay(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, DayOfWeek.FRIDAY, DayOfWeek.SATURDAY, DayOfWeek.SUNDAY) .atHour(12) .create();
Written by Chatsonic