Discussion:
[TECH] Mac http macro program?
Josh Koffman
2017-11-17 17:38:44 UTC
Permalink
Hi all,

I'm looking for a program and I'm not having much luck with my searching.
I'd guess I'm not using the right search terms.

What I'd like is a program that lets you enter a bunch of IP and http
commands, then lets you press an on screen button to send those commands.
This type of functionality exists as a subset of some of the software I
use, but I really need a stand alone version.

Any thoughts on either a solution or what search terms might help me find a
solve? Worse comes to worse I could start learning python and do it via the
command line, but a proper app would be nice.

Thanks!

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
-Douglas Adams
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
James Cameron
2017-11-17 18:07:30 UTC
Permalink
By HTTP commands you mean making GET and POST requests for various
URIs?

Yes, I'd tend to code that kind of thing with Python, and you can make
it a "proper" app with a graphical toolkit. Nice list of them at

https://wiki.python.org/moin/GuiProgramming

For the HTTP interface, the Python module I'd use is "requests", as it
behaves most like a browser. Example and documentation at

http://docs.python-requests.org/en/master/
--
James Cameron
http://quozl.netrek.org/
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Josh Koffman
2017-11-17 21:40:43 UTC
Permalink
Post by James Cameron
By HTTP commands you mean making GET and POST requests for various
URIs?
Hi James,

To be honest, I'm not entirely sure. I need to do more investigation,
it seems that in a browser I have just have to access that specific
URL (ie http://192.168.67.201/config?action=set&paramid=eParamID_MediaState&value=1)
and it works.
Post by James Cameron
Yes, I'd tend to code that kind of thing with Python, and you can make
it a "proper" app with a graphical toolkit. Nice list of them at
https://wiki.python.org/moin/GuiProgramming
For the HTTP interface, the Python module I'd use is "requests", as it
behaves most like a browser. Example and documentation at
http://docs.python-requests.org/en/master/
Well, might be time to find an online Python course...

Thanks!

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
-Douglas Adams
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
James Cameron
2017-11-17 22:04:25 UTC
Permalink
Post by Josh Koffman
Post by James Cameron
By HTTP commands you mean making GET and POST requests for various
URIs?
Hi James,
To be honest, I'm not entirely sure. I need to do more investigation,
it seems that in a browser I have just have to access that specific
URL (ie http://192.168.67.201/config?action=set&paramid=eParamID_MediaState&value=1)
and it works.
That's a GET method. To verify, use a browser with built-in tools
and ask it to list the HTTP requests.

An example is Firefox. Open the page with it, then press Ctrl+Shift+E
shortcut for Tools, Web Developer, Network, then press Reload, and
each request to the server will be listed.
Post by Josh Koffman
Post by James Cameron
Yes, I'd tend to code that kind of thing with Python, and you can make
it a "proper" app with a graphical toolkit. Nice list of them at
https://wiki.python.org/moin/GuiProgramming
For the HTTP interface, the Python module I'd use is "requests", as it
behaves most like a browser. Example and documentation at
http://docs.python-requests.org/en/master/
Well, might be time to find an online Python course...
To help you dive into it, here's a Python script that accesses that
specific URL, and if the status is 200 (normal success), return
without error, otherwise print the status. Naturally it didn't work
for me, but I tested it with a different URL first.

https://gist.github.com/5163dd923681e344a70e3300a22170c5

It is easy to change the parameters, or to set them programmatically.
--
James Cameron
http://quozl.netrek.org/
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Ryan O'Connor
2017-11-17 20:15:58 UTC
Permalink
Hi Josh, I use Postman. There is a Google Chrome extension for it which
should do everything you need from within your web browser (it opens
postman like an app). It's great because it allows you to save and group
all your commands and view a history and formats common response formats
for easy readability.

Ryan
Post by Josh Koffman
Hi all,
I'm looking for a program and I'm not having much luck with my searching.
I'd guess I'm not using the right search terms.
What I'd like is a program that lets you enter a bunch of IP and http
commands, then lets you press an on screen button to send those commands.
This type of functionality exists as a subset of some of the software I
use, but I really need a stand alone version.
Any thoughts on either a solution or what search terms might help me find a
solve? Worse comes to worse I could start learning python and do it via the
command line, but a proper app would be nice.
Thanks!
Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
-Douglas Adams
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Josh Koffman
2017-11-17 21:42:32 UTC
Permalink
Post by Ryan O'Connor
Hi Josh, I use Postman. There is a Google Chrome extension for it which
should do everything you need from within your web browser (it opens
postman like an app). It's great because it allows you to save and group
all your commands and view a history and formats common response formats
for easy readability.
Hi Ryan,

Ah, this looks interesting, at least until I can learn a better way.
Incidentally, they are sunsetting the Chrome extension, and have
created standalone apps. Info here:
http://blog.getpostman.com/2017/11/01/goodbye-postman-chrome-app/

I've downloaded the OSX app and have entered some commands. I'll have
to wait until tomorrow until I am near the machines again to try it
for real.

Thank you!

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
-Douglas Adams
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Justin Richards
2017-11-20 10:50:14 UTC
Permalink
I have used python and perl to request pages (typically on embedded
devices) and parse the response.

Recently i used html with iframes to get pages from many embedded devices
which proved to be clunky but relatively easy.

Finally i used javascript embedded in html to periodically request html
pages and parse the response. There is a catch in that there is security
built into browsers that prohibit this unless the header of the page you
are requesting contains a particular response which escapes me right now or
the javascript/html page actually came from the server that is doing the
requesting.



On 18 Nov 2017 01:44, "Josh Koffman" <***@gmail.com> wrote:

Hi all,

I'm looking for a program and I'm not having much luck with my searching.
I'd guess I'm not using the right search terms.

What I'd like is a program that lets you enter a bunch of IP and http
commands, then lets you press an on screen button to send those commands.
This type of functionality exists as a subset of some of the software I
use, but I really need a stand alone version.

Any thoughts on either a solution or what search terms might help me find a
solve? Worse comes to worse I could start learning python and do it via the
command line, but a proper app would be nice.

Thanks!

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
-Douglas Adams
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Loading...