Monday, June 7, 2021

 LINK FOR CHECKING COMPATIBLITY -  https://betaprofiles.com

LINK FOR DOWNLOADING PROFILES - https://betaprofiles.com

Sunday, November 8, 2020

SCRIPT CODE FOR GOOGLE SHEETS 


var sheetName = 'Sheet1'

var scriptProp = PropertiesService.getScriptProperties()


function intialSetup () {

 var activeSpreadsheet = SpreadsheetApp.getActiveSpreadsheet()

 scriptProp.setProperty('key', activeSpreadsheet.getId())

}


function doPost (e) {

 var lock = LockService.getScriptLock()

 lock.tryLock(10000)


 try {

var doc = SpreadsheetApp.openById(scriptProp.getProperty('key'))

var sheet = doc.getSheetByName(sheetName)


var headers = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues()[0]

var nextRow = sheet.getLastRow() + 1


var newRow = headers.map(function(header) {

 return header === 'timestamp' ? new Date() : e.parameter[header]

})


sheet.getRange(nextRow, 1, 1, newRow.length).setValues([newRow])


return ContentService

 .createTextOutput(JSON.stringify({ 'result': 'success', 'row': nextRow }))

 .setMimeType(ContentService.MimeType.JSON)

 }


 catch (e) {

return ContentService

 .createTextOutput(JSON.stringify({ 'result': 'error', 'error': e }))

 .setMimeType(ContentService.MimeType.JSON)

 }


 finally {

lock.releaseLock()

 }

}

GOOGLE SHEET SCRIPT



 <script>

            const scriptURL = 'https://script.google.com/macros/s/AKfycbxJsqog2J2UKKPcMpFWgNpmXJ9jwxWvc-ItRwFToS2QTgNq_rQ/exec'

            const form = document.forms['google-sheet']

          

            form.addEventListener('submit', e => {

              e.preventDefault()

              fetch(scriptURL, { method: 'POST', body: new FormData(form)})

                .then(response => alert("Thanks for Contacting us..! We Will Contact You Soon..."))

                .catch(error => console.error('Error!', error.message))

            })

          </script>


        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>

        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

FORM IN HTML


 <!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Document</title>

    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">

    <style>

            .register .nav-tabs .nav-link:hover{

                border: none;

            }

            .text-align{

                margin-top: -3%;

                margin-bottom: -9%;


                padding: 10%;

                margin-left: 30%;

            }

            .form-new{

                margin-right: 22%;

                margin-left: 20%;

            }

            .register-heading{

                margin-left: 21%;

                margin-bottom: 10%;

                color: #e9ecef;

            }

            .register-heading h1{

                margin-left: 21%;

                margin-bottom: 10%;

                color: #e9ecef;

            }

            .register{

                background: -webkit-linear-gradient(left, #055a4f, #00c6ff);

                margin-top: 3%;

                padding: 3%;

                border-radius: 2.5rem;

            }

            .btnSubmit

            {

                width: 50%;

                border-radius: 1rem;

                padding: 1.5%;

                color: #fff;

                background-color: #03612e;

                border: none;

                cursor: pointer;

                margin-right: 6%;

                color: rgb(246, 246, 252);

                margin-top: 4%;

            }

    </style>


</head>

<body>

    

<div class="container register">

            <div class="row">

                <div class="col-md-12">

            <div class="tab-pane fade show active text-align form-new" id="home" role="tabpanel" aria-labelledby="home-tab">

            <h3 class="register-heading">Connect Google Spreadsheet to HTML</h3>

            div class="row register-form">

            div class="col-md-12">

            <form method="post" autocomplete="off" name="google-sheet">

            div class="form-group">

            <input type="text" name="Name" class="form-control" placeholder="Your Name *" value="" required=""/>

            </div>

             <div class="form-group">

             <input type="text" name="Email" class="form-control" placeholder="Your Email *" value="" required=""/>

            </div>

            <div class="form-group">

            <input type="number" name="Phone" class="form-control" placeholder="Your Contact Number *" value="" required=""/>

            </div>

            <div class="form-group">

            <input type="submit" name="submit" class="btnSubmit btn-block" value="Login" />

            </div>

             </form

            </div>

            </div>

            </div>

            </div>

            </div>

         </div>

</body>

</html>


Tuesday, May 12, 2020

BUILD YOUR OWN VOICE ASSISTANT LIKE JARVIS

import speech_recognition as sr
import os
import sys
import re
import webbrowser
import smtplib
import requests
import subprocess
from pyowm import OWM
import urllib
import urllib.request
import json
from bs4 import BeautifulSoup as soup
import wikipedia

from time import strftime
def AssistantResponse(audio):
    "speaks audio passed as argument"
    print(audio)
    for line in audio.splitlines():
        os.system("say " + audio)
def myCommand():
    "listens for commands"
    r = sr.Recognizer()
    with sr.Microphone() as source:
        print('Say something...')
        r.pause_threshold = 1
        r.adjust_for_ambient_noise(source, duration=1)
        audio = r.listen(source)
    try:
        command = r.recognize_google(audio).lower()
        print('You said: ' + command + '\n')
    #loop back to continue to listen for commands if unrecognizable speech is received
    except sr.UnknownValueError:
        print('....')
        command = myCommand();
    return command
def assistant(command):
    "if statements for executing commands"
    if 'shutdown' in command:
        AssistantResponse('Bye bye Sir. Have a nice day')
        sys.exit()
#open website
    elif 'open' in command:
        reg_ex = re.search('open (.+)', command)
        if reg_ex:
            domain = reg_ex.group(1)
            print(domain)
            url = 'https://www.' + domain
            webbrowser.open(url)
            AssistantResponse('The website you have requested has been opened for you Sir.')
        else:
            pass
#greetings
    elif 'hello' in command:
        day_time = int(strftime('%H'))
        if day_time < 12:
            AssistantResponse('Hello Sir. Good morning')
        elif 12 <= day_time < 18:
            AssistantResponse('Hello Sir. Good afternoon')
        else:
            AssistantResponse('Hello Sir. Good evening')
   #joke
    elif 'joke' in command:
        res = requests.get(
                'https://icanhazdadjoke.com/',
                headers={"Accept":"application/json"})
        if res.status_code == requests.codes.ok:
            AssistantResponse(str(res.json()['joke']))
        else:
            AssistantResponse('oops!I ran out of jokes')
#top stories from google news
    elif 'news for today' in command:
        try:
            news_url="https://news.google.com/news/rss"
            Client=urllib.request.urlopen(news_url)
            xml_page=Client.read()
            Client.close()
            soup_page=soup(xml_page,"xml")
            news_list=soup_page.findAll("item")
            for news in news_list[:15]:
                AssistantResponse(news.title.text.encode('utf-8'))
        except Exception as e:
                print(e)
#current weather
    elif 'current weather' in command:
        reg_ex = re.search('current weather in (.*)', command)
        if reg_ex:
            city = reg_ex.group(1)
            owm = OWM(API_key='ab0d5e80e8dafb2cb81fa9e82431c1fa')
            obs = owm.weather_at_place(city)
            w = obs.get_weather()
            k = w.get_status()
            x = w.get_temperature(unit='celsius')
            AssistantResponse('Current weather in %s is %s. The maximum temperature is %0.2f and the minimum temperature is %0.2f degree celcius' % (city, k, x['temp_max'], x['temp_min']))
#time
    elif 'time' in command:
        import datetime
        now = datetime.datetime.now()
        AssistantResponse('Current time is %d hours %d minutes' % (now.hour, now.minute))
    elif 'email' in command:
        AssistantResponse('Who is the recipient?')
        recipient = myCommand()
        if 'rajat' in recipient:
            AssistantResponse('What should I say to him?')
            content = myCommand()
            mail = smtplib.SMTP('smtp.gmail.com', 587)
            mail.ehlo()
            mail.starttls()
            mail.login('your_email_address', 'your_password')
            mail.sendmail('sender_email', 'receiver_email', content)
            mail.close()
            AssistantResponse('Email has been sent successfuly. You can check your inbox.')
        else:
            AssistantResponse('I don\'t know what you mean!')
#launch any application
    elif 'launch' in command:
        reg_ex = re.search('launch (.*)', command)
        if reg_ex:
            appname = reg_ex.group(1)
            appname1 = appname+".app"
            subprocess.Popen(["open", "-n", "/Applications/" + appname1], stdout=subprocess.PIPE)
            AssistantResponse('I have launched the desired application')
#p
#change wallpaper
    elif 'change wallpaper' in command:
        folder = '/Users/robinsharma/Downloads/wallpapers/'
        for the_file in os.listdir(folder):
            file_path = os.path.join(folder, the_file)
            try:
                if os.path.isfile(file_path):
                    os.unlink(file_path)
            except Exception as e:
                print(e)
        api_key = 'fd66364c0ad9e0f8aabe54ec3cfbed0a947f3f4014ce3b841bf2ff6e20948795'
        url = 'https://api.unsplash.com/photos/random?client_id=' + api_key #pic from unspalsh.com
        f = urllib.request.urlopen(url)
        json_string = f.read()
        f.close()
        parsed_json = json.loads(json_string)
        photo = parsed_json['urls']['full']
        urllib.request.urlretrieve(photo, "/Users/robinsharma/Downloads/wallpapers/a") # Location where we download the image to.
        subprocess.call(["killall Dock"], shell=True)
        AssistantResponse('wallpaper changed successfully')
#askme anything
    elif 'tell me about' in command:
        reg_ex = re.search('tell me about (.*)', command)
        try:
            if reg_ex:
                topic = reg_ex.group(1)
                ny = wikipedia.summary(topic)
                print(ny)
        except Exception as e:
                print(e)
                AssistantResponse(e)
AssistantResponse('Hi User, I am Sofia and I am your personal voice assistant, Please give a command or say "help me" and I will tell you what all I can do for you.')
#loop to continue executing multiple commands
while True:

    assistant(myCommand())

Friday, January 24, 2020

My Lost Thought!

Loved you, It’s funny how one letter can change a word. I am a type of person to overthink I look at everything that happened in past and who I am now. I am still wondering where I am going. I thought life would be something I could share with someone but that didn’t go as planned. Here's to another year of searching for answer.


I need to let go to what I lost because I"ll never get it back "You are the greatest fool in history of love if you could'n recognise my honest love."


"If only you could understand how people are sure of what they all looking for;
                                                   I would tell you the truth,  that got that it’s the moment of brutal honesty which made me stick around for long."

If only I didn’t have to wait for last moment instead ,
if only I was sure that moment will be the best for you too.

I would tell you the truth
 If only I could tell you how helpless I feel when I try to search for Realty in your lies ;
                                               Happiness when you feel free To laugh smile and cry.


                                                                                           -Rg

Monday, December 23, 2019

YOU MAKE ME FEEL WORTHLESS!

I feel as though I invest in few people too easily I am always making excuses for those who don’t deserve be. I somehow hello is my worth in the process. I became everything that I don’t want to be I was taught to see flaws in my myself because they pointed them out but in reality I am not the one who isn’t worth it, you are I have been putting myself down for two long I should not let others treat me like I am worthless because deep down. I know I am not the weirdest thing happened the other day I realised that I am not going to find someone who is still a said you deserve better but you didn’t really don’t. I don’t want to be spiteful but it’s going to come across the way I have put my heart out there with everything I do I want people to smile and feel less alone I am drawn to broken wings and I have been this way for as long as I can remember this is where I find my worth and give my attention to those who care I am always caught up in feeling but I am tired of being taken advantage of from me to you go fuck yourself.




1. What do you do when the person who broke your heart is the only one who can fix it?
2. What am I supposed to do when the best part of me was always you?
3. 4. Two people who break up could never be friends. If they can stay friends, then it means that they are still in love or that they never were.
4. A breakup is like a broken mirror. It is better to leave then risk hurting yourself trying to pick up all of the broken pieces.
5. Sometimes you just need to erase the messages, delete the number, and move on.
6. If someone makes you miserable more than they make you happy, then it is time to let them go, no matter how much you love them.
7. It takes just a few seconds to say hello, but it takes forever to say goodbye.
8. Just because I let you go, it does not mean that I wanted to.
9. The people who are quick to walk away are the ones who never meant to stick around.
10. All I did was love you and all you did was hurt me.
11. Sometimes you have to forget what you want in order to remember what you deserve.
12. Missing you is not what hurts. It is knowing that I had you and lost you.
13. If you really love someone, set them free. If they do not come back to you, then it was not meant to be.
14. In some relationships there comes a time when the two people just outgrow each other.
15. Love is unconditional, but relationships are not.
16. Nothing is worse than seeing the two of you together and knowing that I will never have you again.
17. You treated me like an option, so I left you like a choice.
18. The hottest love has the coldest end. -Socrates
19. The heart was made to be broken. -Oscar Wilde
20. Sometimes good things fall apart so better things can come together.
21. I miss your smile, but I missed mine more.
22. If someone does not care about losing you, then move on. There are many people out there that would die if it meant losing you.
23. I could never hate you for not loving me anymore, but I hate myself because I still love you.
24. Distance will sometimes let you know who is worth keeping and who is worth letting go of.
25. If you are not sure where you stand with someone, then it might be time to start walking.
26. It is sad how someone can go from being the reason you were smiling to being the reason that you cry yourself to sleep.
27. I hope that one day, you will look back at what we had and you regret everything that you did to let it end.
28. I thought that I was over you, but every time my phone vibrates or rings, I find myself wishing that it was a text from you.
29. Even though I saw it coming from a mile away, it still hurts,
30. If you start to miss me, remember that I didn’t walk away. You let me go.
31. It can be very hard to move on when you don’t know why you have broken up in the first place.
32. It is the hardest thing not being able to talk to someone that you used to talk to every day.
33. It isn’t fair that I’m sitting here thinking of you and that you probably haven’t thought of me at all since we broke up.
34. Missing you comes in waves and tonight I am drowning
35. It is one of the hardest things in life to let go of something that you once thought was real.
36. I’m barely breathing with a broken heart that is still beating.
37. I miss how happy I was when I was with you.
38. I know that there is someone out there for me, but I wish that person could be you.
39. I can feel you forgetting me.
40. I am technically single but my heart is taking by someone who is no longer mine.
41. The worst feeling in the world is when you know that you both love each other but you just can’t be together.
42. Real feelings don’t just magically go away.
43. I used to think that asking you out was the hardest and scariest thing that I would ever have to do. You were everything that I thought I wanted, but would you want me back? But now I realize that saying goodbye forever is the hardest thing to do.
44. There is nothing less lonely than when someone you care about becomes a complete stranger.
45. The hardest thing I’ve ever done was walk away when I still loved you.
46. The worst thing is sleeping so you don’t have to think about the heartbreak.
47. Breaking up is like having the worst nightmare right after having the best dream.
48. I broke my own heart by loving you.
49. I wonder how long it will be before I am just a memory.
50. A relationship is only meant for two people. But some people do not know how to count.
51. If someone cheats on you, then they do not deserve you.
52. When you cheat, not only do you break someone’s heart, you break the chance of a future as well.
53. I am a good enough person to forgive you, but I am not stupid enough to trust you again.
54. Never cry for the person who has hurt you. Just smile and thank them for giving you a chance to find someone better who actually deserve you.
55. Trust can take years to build, seconds to break, and forever to repair.
56. Relationships are not a test, so why cheat?
57. You told me lies and made me cry. Now it is time for me to say goodbye.

 LINK FOR CHECKING COMPATIBLITY -  https://betaprofiles.com LINK FOR DOWNLOADING PROFILES - https://betaprofiles.com