Is there a way to send data/messages from the chrome extension to the thunderbird add-on? I didn't find any API.
Use Native Messaging to send all information required to compose an e-mail (to, subject, body, attachment) from your Chrome extension to a native application, such as a Python script:
https://developer.chrome.com/docs/apps/nativeMessaging/
The Python script (which you must program yourself) then calls Thunderbird from the command line, with the appropriate command-line arguments:
http://kb.mozillazine.org/Command_line_arguments_-_Thunderbird
Related
I want to get the content-transfer size like in chrome devtool network tab through chrome extension API but it doesn't have events for this.
Also checked webRequest API.
Low-level precise approach
DevTools itself uses CDP (Chrome DevTools Protocol) events like Network.responseReceived and its encodedDataLength field (source).
It can be used in an extension via chrome.debugger API:
attach the debugger to the tab
navigate it to the URL or call chrome.tabs.reload()
send debugger command Network.enable
register an event listener for Network.responseReceived
detect the moment the page is loaded by using a sliding timeout aka debounce
An annoying side-effect is that Chrome shows a warning in all tabs when the debugger is used by an extension. If you need more info, search for chrome.debugger examples yourself (here's a few official ones) and inspect the source code of devtools.
Content-Length approach
Another approach is to use Content-Length HTTP header but it's not guaranteed to be present on all responses: here's an example that you can further enhance with a check for fromCache field that's provided in a separate onCompleted event.
I am trying to build a gmail add-on which starts automatically when the user opens an email and display them some information. How can I do that?
You could start with this document https://developers.google.com/gsuite/add-ons/how-tos/building-gsuite-addons
you need a script project and standalone script
In Gmail app, there are 3 triggers, homepage trigger (when the user is at homepage), contextual trigger (when the user is reading an email) and compose trigger (when user composing an email), you could declare the triggers on add-on manifest file
create handler as CB function for these triggers and declare them on the manifest file
you could easily install the add-on by Publish -> deploy from manifest -> install add-on (on your Gmail account)
I extremely suggest read the doc, as there is amazing documentation, how to developing G suite add-on
There is an Chrome extension you can use to automatically open any add-on from Gmail, Calendar, Drive and Docs when you open the corresponding web page.
https://chrome.google.com/webstore/detail/auto-open-add-on/bcjnialkobgkdkbdclhdnbdcdgdcgdlo
Old days many admins use sms-gates for sending important informations from their systems e.g. "Power down, UPS is working now!", "Power Up, UPS is off!" or "CPU Temp too high!". Today in Facebook era we use messenger instead of SMS, so I wonder if I could create a command-line bash or php script for such thing.
The idea - cron checks every 10 minutes the condition and if it is true, sends message to my messenger.
The issues:
I don't want to use my fb account for sending - I'd like to get message
from "System 1", "System 2", because i have more than one system to
admin.
The bash part is easy for me, I need tips for Facebook solutions:
do I have to get FacebookAppId (and do I have to create AppId for
each system or just one AppId)
how to "join/confirm/accept" "System 1" account with my Facebook Account
is it possible to send messages to more than one FBAccount
any other hints what should i look for.
I found Notification App, but i think that it doesn't send message to messenger, so it would be useless.
The Chat API was removed with v2.0 of the Graph API, there is no way to send messages with an API anymore. Btw, messages are for communcation between real users, they should not be used as notification system anyway. SMS is still a good option for those kind of warnings imho.
Using a Page and the /conversations endpoint would not work either:
Pages can only reply to a message - they cannot initiate a conversation. Also, a Page can only respond twice to a particular message, the other party will have to respond before they can reply again.
Source: https://developers.facebook.com/docs/graph-api/reference/v2.3/conversation/messages#publish
I think for your special purpose, twitter may be a better option. Twitter accepts tweets from API. So what you need to do is to set up an account to publish your system status either regularly or event-triggingly and follow it in your own personal account.
And there are already plenty of open source projects focusing on tweeting via API, and t is the one I am currently using.
So there are a couple of command line apps to do this.
There is a libpurple extension (https://github.com/dequis/purple-facebook) which works. However purple doesn't seem to support the idea of message history. This is a shame since I imagine offline messages is the default way most people use facebook.
There is an single use command tool for facebook as well: https://www.npmjs.com/package/fb-messenger-cli which does support history. Unfortunately this is a TUI rather than a command line application and doesn't seem to depend on a separate facebook library.
Some hacking or terrible expect glue could work around this.
I just published a service exactly for that use case :
https://www.nimrod-messenger.io/
It's at an early stage. Feedbacks are more than welcome :-)
Sending facebook message in bash script
IDEA
I needed a script (which work on my work/local mac) that checks server. If there are problems, script will send me messages on Facebook.
Dependencies
need to install: https://github.com/mjkaufer/Messer
Solution, bash script
FB_SENDER_LOGIN=""
FB_SENDER_PASSWORD=""
function send_fb_message {
FB_MESSER_COMAND="messer $FB_SENDER_LOGIN $FB_SENDER_PASSWORD --command='m \"$1\" $2'"
eval "$FB_MESSER_COMAND"
}
RECIPIENT_NAME_DISPLAYED_IN_FACEBOOK_WEBSITE="Vasily Bodnarchuk"
MESSAGE="Houston, we have a problem!!!"
send_fb_message "$RECIPIENT_NAME_DISPLAYED_IN_FACEBOOK_WEBSITE" "$MESSAGE"
Automated Facebook message
I was looking for something like this exactly and found that Messer is the way to go.
Solution
Look at this repo called Messer https://github.com/mjkaufer/Messer
(it works with 2FA too but not with app passwords)
Implementation
See Readme
I needed it to run automatically so I used it's non-interactive mode with a bash script:
message="Hey, what\'s up bro"
FULLPATH/node_modules/.bin/messer --command="m \"Myfriends Name\" $message"
I don't like to install something like this globally through NPM so I used the /node_modules/.bin/messer executable in the project's folder.
Used double quotes escaped instead of single quotes to be able to use variables inside command.
Drawback: Messer can only send, not receive.
Anyway, I have a script that I want to run whenever I receive an email on gmail. And if possible a subject specific email. is such a thing possible and if so, what programs do I need to allow it.
You can't instruct gmail to trigger an external script for you. I think you've got a few basic choices. In order of increasing difficulty and complexity:
1) Configure a gmail filter to deliver your desired messages to a special folder. Write a script to poll that folder, download (or delete or mark as read) messages it finds there, and then launch your local script. Set up a cron on your local machine to run the script every few minutes. You can poll the folder with IMAP or the GMAIL API. IMAP is probably easier. This will be tricky with shell, you're better of with Python, PHP, or similar.
2) Configure a gmail filter to forward your desired messages to an address on a mail server that you control. Use procmail or similar to intercept the incoming messages and launch your script.
3) Set up an account at Mailgun and configure the emails so they get delivered there directly. (Or forward from gmail as in #2.) Configure Mailgun to launch an API request when it receives messages. Build an API handler to receive the request. Launch your process from your API handler.
I have never done it, but I guess the first thing you should do is to take a look at the Google's Gmail API...
What is the Gmail API?
The Gmail API gives you flexible, RESTful access to the user's inbox,
with a natural interface to Threads, Messages, Labels, Drafts, and
History.
It seems to fit what you want - at least, without knowing the details of what you want to do.
The Gmail API can be used in a variety of different applications,
including, typically:
Read-only mail extraction, indexing, and backup
Label management
(add/remove labels)
Automated or programmatic message sending
You can use several programming languages - maybe the trick is using your programming language of choice to write a wrapper for the .sh script... I hope this helps!
Is it possible to send a text message or email automatically from a chrome extension triggered by an event on a web page? This is for notification within a company, it's not meant to be used by third parties so it's not a privacy issue.
One possible way that you could do this (if you have a webserver) is sending the user to a page that is hosted somewhere online, and run a PHP script that emails the user. You would have to use this method because:
You can't easily use PHP in a chrome extension
You can't send emails through Javascript/jQuery