I’ve a robot with Wi-Fi: it's set up as server. I’ve a website and I want to change some of the robot’s parameters by entering data into the website. How can I do this?
you would write a JSON API in you favorite Language/Framework and than invoke it from a website. Look for AJAX call with javascript
Part of it depends on what system you use. This becomes easy if you use ROS. Maybe try looking into this: http://wiki.ros.org/Robots/TurtleBot/indigo
Other wise, you just need to set up a receiver on the robot. In that case look at socket programming.
Related
I am embarking on a POC to replace a Power BI dashboard that can’t do all the visualizations we need with a dash app. One major requirement is to be able to pass multiple filters to the app via url in a manner similar to the Power BI capability.
I have tried to research this and see references to URL callbacks and believe this provides the functionality I will need, but I don’t yet understand dash apps well enough to be sure.
I’m not asking how to, just whether or not it can be done. Thanks!
You can. Use the dcc.Location component (docs), and structure any callbacks that need to listen to the URL to have an Input based on that component. You can even pass multiple things with it, such as "filter_1/3/filter_2/5/filter_3/1" and then .split('/') to break up the string and parse the values.
Im trying to send some data to a form on a site were im a member using cURL, but when i look at the headers being sent, they seem to have been encrypted.
Is there a way i can get around this by making the computer / server visit the site and actual add the data to the inputs on the form and then hit submit, so that it would generate the correct data and post the form ?
You have got a few options:
reverse engineer the JavaScript that does the encryption (or possibly just encoding) process
get a browser engine (e.g. the Gecko engine), and add some scripting to it to fill in the forms and push the submit button - of course you would need JavaScript support within the page itself
parse the HTML using an HTML parser, feed the JavaScript in it to a JavaScript runtime with the correct libraries, fill in the "form" and hit the submit button
It's probably easiest to go for the first option. The JavaScript must be in the open to be able to be executed in the browser. But it may take some time to reverse-engineer as it is likely obfuscated.
You can use a framework to automate user interaction on the web pages, like Selenium.
This would enable you to not bother reverse engineering anything.
Selenium has binding in various languages, including Python and java.
Provided the javascript is visible on the website in question, you should be able to simply copy and paste their encryption routines to prepare the headers exactly as they do
A hacky fix if you can isolate the function that encodes the data you type in the form - is to use something like PyV8 to execute the JS inside python.
Use AutoHotKeyIt and actually have it use the Browser Normally. It can read from files, and do repetitive tasks infinitely. Also you can push a flag to make it only happen within that application, which means you can have it minimized and yet still preform the action.
You seem to be having issues with the problem of them encrypting the headers and such, so why not simply use that too your advantage? Your still pushing the same data in, but now your working around their system. With little to no side effect too you.
I need to implement direct call feature via vicidial in my web application.
Let me explain the flow to better understand what I need to do. user would be able to login in vicidial via a webpage of my app. then can call on any number by entering number.
Is there any doc or wiki available to implement this feature. Guidance in simple steps would also be appreciating.
Thanks in advance :)
We implemented something like that using a product called WombatDialer that offers good APIs and is quite easy to set up (well, easier than ViciDial).
See http://www.wombatdialer.com/manuals/WD_UserManual-chunked/ar01s08.html for an API reference.
Can anyone please recommend any good Load Testing software?
I have a website which updates scores every minute via ajax calls and need a load testing software which supports ajax calls (javascript) too!
This is a pretty broad question that depends greatly on exactly what you want to test and how you define "good" software. Many people will say you can't load test AJAX based sites using HTTP-simulation tools. We do it every day, so I can tell you that isn't true. However, the difficulty of the task varies greatly depending on the testing software you choose and the complexity of the site and scenarios you are testing.
My recommendation is to pick a few tools within your price range and evaluate how well they work for your particular scenario. If they have good support, you should contact them with any difficulties. If they can't get you going in short order, move on to the next product.
(Disclaimer: I work for Web Performance - our Load Tester product handles most AJAX scenarios just fine - which may be why we're on the first google page for "ajax load testing").
Ajax is just an HTTP call, so you have many options.
I can recommend WebLOAD.
Works well with Ajax. The script is written in JavaScript, which is a plus.
Although I cant recommend an AJAX load testing utility I can however recommend an alternative to normal AJAX calls to me it sounds like what you need is APE (Ajax Push Engine).
So instead if your application spawn repeatedly contacting the server
Your App -> Do you have a message for me server?..
Server -> No..
repeat X 10 Ajax Calls until Server -> Yes!
What APE does it pushes the data/information directly to your users browser without
the application contacting the server. Think of it this way, the server "shouts" a message and your web apps then receive this message and interprets it. This concepts is known as long polling.
APE is pretty darn fast and not that difficult to implement.
Heres a link to the APE project - http://ape-project.org
Theres a few guys that have some excellent examples available on the Internet,
heres a link to an interesting one which uses APE to create an SMS gateway.
http://www.ifc0nfig.com/esenape-send-and-receive-sms-in-real-time-using-ape-jquery-php-and-libape_controller/
I hope this interests you.
Regards
I've read that its bad (not advised) to use User Agent Sniffing to send down the correct content for a mobile browser, so I'm wondering what IS the best way to do this?
I'm using ASP.NET MVC, and I've built my site and it works well on desktop browsers, so I'm looking to begin building a mobile version. When a mobile browser comes to my site, I'd like to use a different set of Views, which ideally posses the following attributes:
Link to pre-scaled images
Use minimal javascript
Remove all but essential content
My first thought was to sniff the user agent, and then send down a different .CSS file, but as stated above I've read that this is a bad way to do this, so I'm asking you for your thoughts.
The user agent is really all you have in a HTTP GET request, but you should let someone else maintain the list. We use the Microsoft Mobile Device Browser File with a custom view engine in a manner roughly similar to this Scott Hanselman post.
The best way to detect a mobile browser is to use this wonderful codeplex project:
http://mdbf.codeplex.com/
For background on how you could create targeted views read here:
http://www.hanselman.com/blog/MixMobileWebSitesWithASPNETMVCAndTheMobileBrowserDefinitionFile.aspx
The simplest approach could be use a separate domain "m.yourdomain.com" or "yourdomain.mobi" (Source) that way you can assume that the user is on a mobile device.
While I believe it's frowned upon to sniff for browser to determine capability and you should use capability sniffing, such as JQuery.support. When it comes to actually presenting significantly different layouts then I think you have to sniff for the browser ID and act accordingly.