This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.DeleteRunningJobFromFinished = functions.database.ref('finished-jobs/{key}').onCreate(event => | |
{ | |
const runningRef = event.data.adminRef.root.child('running-jobs') | |
const jobId = event.data.val()['protoPayload']['serviceData']['jobCompletedEvent']['job']['jobName']['jobId'] | |
runningRef.orderByChild('protoPayload/serviceData/jobInsertResponse/resource/jobName/jobId') | |
.equalTo(jobId).once("value", function (snapshot) { | |
snapshot.forEach(function (data) { | |
runningRef.child(data.key).remove() | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"api_id": "My App ID", | |
"chat_id": CHAT_ID, | |
"api_hash": "API HASH", | |
"phone": "My Phone Number" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
['ביקורת על הסוחר: @weed1614\nאיזור פעילות: באר שבע - באר שבע', 'חוות דעת מספר: #71584\nנשלח מאת: @Hoover656\nנשלח בתאריך: 15:25 22/12/17', 'חוות הדעת:\nשווה כל שקל,ירק ברמה ממש גבוהה,יבש,טעים,מפוצץ באבקנים.', '\nתקשורת: 🌟🌟🌟🌟🌟 (5/5)\nאיכות: 🌟🌟🌟🌟🌟 (5/5)\nמחיר: 🌟🌟🌟🌟🌟 (5/5)\nהמתנה: 🌟🌟🌟🌟🌟 (5/5)', 'להגשת חוות דעת: @TelegrassBot לשירותכם!'] | |
['ביקורת על הסוחר: @Weedweedow2\nאיזור פעילות: תל אביב - תל אביב - יפו', 'חוות דעת מספר: #71585\nנשלח מאת: @ben_shelly\nנשלח בתאריך: 15:25 22/12/17', 'חוות הדעת:\n* הבטיחו 5+1 - הביאו 5.25\n* קבענו שעה - הגיעו בשעה איחור\nוכל זה תוך כדי סחבת של טלפונים בין השליח ל"מנהל" ואליי ...', '\nתקשורת: 💩 (0/5)\nאיכות: 🌟🌟🌟 (3/5)\nמחיר: 💩 (0/5)\nהמתנה: 💩 (0/5)', 'להגשת חוות דעת: @TelegrassBot לשירותכם!'] | |
['ביקורת על הסוחר: @cr73333\nאיזור פעילות: באר שבע - באר שבע', 'חוות דעת מספר: #71583\nנשלח מאת: @Squid51\nנשלח בתאריך: 15:24 22/12/17', 'חוות הדעת:\nsquid:\nשלחתי לבחור הודעה ושאלתי אם יוכל לתת הנחה קטנה, תוך כמה דקות הסכים ועשה אימות מהיר, הגעתי אליו וקיבלתי אצבע מפנקת מאד! גם עשה הנחה וג |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT CORR(price,wait) as price_wait, CORR(price,communication) as price_communication, CORR(price, quality ) as price_quality, | |
FROM [telegrass_reviews.reviews] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT quality ,ratio * 100 AS percent,total FROM ( | |
SELECT quality , count(*) AS total, RATIO_TO_REPORT(total) OVER() AS ratio | |
FROM [telegrass_reviews.reviews] | |
GROUP by quality | |
) | |
SELECT price ,ratio * 100 AS percent,total FROM ( | |
SELECT price , count(*) AS total, RATIO_TO_REPORT(total) OVER() AS ratio | |
FROM [telegrass_reviews.reviews] | |
GROUP by price | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
split col: column2 on: '\\n' | |
split col: column1 on: ':' | |
drop col: column2 | |
rename col: column8 to: 'dealer' | |
set col: dealer value: proper(dealer) | |
delete row: isnull(dealer) | |
split col: column7 on: '-' | |
split col: column1 on: ':' | |
drop col: column7 | |
rename col: column8 to: 'region' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT COUNT(*) as num_bigram,bigram FROM | |
( | |
SELECT | |
split | |
( | |
REGEXP_REPLACE(review, '([^\\s]+\\s[^\\s]*)\\s', '\\1|') + | |
'|'+ | |
REGEXP_REPLACE(review, '([^\\s]+)\\s([^\\s]+\\s?)', '\\1|\\2'), | |
) as bigram | |
FROM [telegrass_reviews.reviews] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT HOUR(sent_time) hour_submission, | |
COUNT(*) as num_submissions | |
FROM [[telegrass_reviews.reviews] | |
GROUP BY hour_submission | |
ORDER by hour_submission |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT COUNT (DISTINCT(submitter )) as users ,ltrim(rtrim(city)) as city FROM [aviv-playground:telegrass_reviews.reviews] | |
group by (city) | |
order by users desc limit 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
city | population | unique_reviewers | ratio | |
---|---|---|---|---|
Tel Aviv | 438818 | 3783 | 0.8620886107680177 | |
Givatayim | 58508 | 424 | 0.7246872222602038 | |
Bat Yam | 128904 | 761 | 0.5903618196487308 | |
Ramat Gan | 153675 | 817 | 0.5316414511143648 | |
Ramat HaSharon | 45066 | 216 | 0.47929703102116894 | |
Ness Ziona | 48161 | 218 | 0.4526484084632795 | |
Herzliya | 93116 | 414 | 0.4446067270930882 | |
Kfar Saba | 98981 | 435 | 0.43947828371101527 | |
Beersheba | 205810 | 886 | 0.4304941450852728 |