Nodejs and/or PHP mobile detection - node.js

Is there a good and reliable library or method, or whatever, that can detect if the request is coming from a mobile environment?
I found a few packages, but non seems to work properly. I am looking for a basic/simple one that is able to detect just this: isMobile; isDesktop. Needs to be reliable, up to date and working.
If there is none free, even payed solutions would be acceptable. I am not looking for 100% detection, but I expect that top most popular devices to be detected without problem.
I am looking for a nodejs (express) solution, and/or a PHP one.

For PHP you can use Mobile-detect. According to its official description in Github, Mobile_Detect is a lightweight PHP class for detecting mobile devices.
For node.js you can use mobile-detect.js. It's a port of Mobile-detect to javascript.

DeviceAtlas has a good article:
How to detect a mobile browser by Pawel Piejko.
They have examples with PHP, Java and Python and they have API to use. It is a a paid service but with free trial.
Mobile detection is a complicated problem. Of course it's easy to detect an iPhone with some client-side JavaScript, but mobile devices are not only iPhones or Android phones. And if you want to detect it before running client-side JavaScript like you need here then you cannot rely only on client-side JavaScript.
More options
General options:
WURFL, 51Degrees, OpenDDR, MobileESP, ua-parser, Detect Mobile Browsers.
Node modules:
mobile-detect,
device-detect,
detect-mobile-browser,
sniffr,
dagent,
device-detective,
ismobilejs.

Related

How to develop Spotify Desktop Applications, now Libspotify is discontinued

have done my due diligence, and not found any other posts that answer this question, but as usual, if you know a similar question, point me that way!
I noticed a long time back that Libspotify has been dicontinued:
(https://developer.spotify.com/technologies/libspotify/)
So, my question is - what should we do for developing Desktop applications?
They do state: "We hope to be able to provide you with a new library for other platforms." But, this has been going on since 2015!
I have seen many projects in GitHub still using Libspotify - so what should we do? An update was promised "in the upcoming months" but I've not seen anything yet.
What should we do for developing Desktop Applications?
We at Spotify don't currently provide playback as part of our platform offering outside of our iOS and Android SDKs, and I don't have any updates on that at the moment. As mentioned on the website, we hope to be able to provide playback SDKs for more platforms in the future. We don't support any new development on libspotify.
You can use the Spotify Web API to interact with Spotify in a variety of ways, including getting information about metadata, and accessing/modifying user libraries and playlists, which may be useful. You can also use the Applescript API to control playback on macOS, which may also help.
The Spotify Web API is pretty straight forward to use. Of course it defines the protocol rather than implements it so it is OS independent.
I put together a few classes to help unwrap some of the JSON parameters simply. These were written in Swift for macOS.

Implementing Audio chat with Socket.IO and NodeJS

I have created a chat application using sails.js (node.js) and socket.IO.
I need to implement audio chat and file transfers along with it.
Could anyone help me in getting basic tutorial links for integrating WebRTC with socket.IO?
Thanks in advance.
If I were you, I would use a WebRTC library providing both the client and the server side. Check EasyRTC, SimpleWebRTC, PeerJS or others. Most libraries are implemented in Javascript and run in Node.js.
You will find tutorials in their respective websites.
I personally use PeerJS, the code and documentation are both very good, and it fully supports data channels (useful for file transfer). The only thing is that there are only 2 founders, and the community seems quite small.
I am also planning to make your kind of app on nodejs. During my research I found that WEBRTC support for mobile browsers is limited. In todays world whenever we are building a Web app we consider that a major portion of our users are going to use it on mobile phone. WebRtc is supported on android browsers like chrome, Firefox and opera. But on iPhone it doesn't support safari nor windows phone browsers.
You should take a look at Wowza streaming cloud at https://www.wowza.com/docs/wowza-streaming-cloud-free-trial

Posting to Instagram via Script/Online/Program. Anything is good but mobile

I just wanted to know if there is a way to upload images to Instagram WITHOUT using iOS / Android?
I'm really desperate for a solution, if I can't find anything I will have to run a virtual android device or something like that (I have a virtual machine running Windows XP 24/7 anyway)!
Instagram's official RESTful API does not allow for uploading photos, since they want to encourage "life on the go."
However, some work has been put together to document their iPhone API, and some unofficial client libraries have even been made. Check out https://github.com/mislav/instagram/wiki
It seems that's your only alternative at the moment. None of the unofficial libraries look very complete, so you'd have to do the work of sending requests manually, using the reverse-engineered API specs provided in the wiki.

Is it possible to develop Google Chrome extensions using node.js?

I'd like to start developing Google Chrome extension using node.js (since I've already written a "text-to-song" script in node.js, and I'd like to turn it into a Chrome extension.) What would be the most straightforward way of approaching this problem?
Actually it is. Look at this Developers Live-cast. This is something I've been looking for as well, and this would help you.
This brings your node applications bundled to your browser.
Here is the repo!
EDIT:
I've noticed that this old answer of mine keeps getting upvotes now and then (thank you all).
But nowadays I'm more an advocate of using web apps instead of bundling your application into many platforms like the chrome store or whatever.
You can check the google's post here and here indicating some directions.
In practice I advise for you to start building a progressive web app (PWA) with offline capabilities using service worker and progressive stuff.
There are plenty of resources around the web nowadays and you can offer a much richer application that may achieve a much broader audience if you do it the right way.
Thanks again, and good coding.
Simple answer is NO, unless you can find a way to install node.js with an extension using NPAPI.
Nodejs and a Google Chrome Extension do have a couple things in common i.e they both understand javascript and they both use the v8 javascript engine.
Google Chrome Extension
"Google Chrome Extensions are small software programs that can modify and enhance the functionality of the Chrome browser".
To develop a Google Chrome Extension you should write some javascript and or html/css.
Then you can run the extension in your browser.
If you wish for others to download your extension you will have to provide config.json file that describes you extension sets permissions etc.
Nodejs
"Node.js is a platform built on Google Chrome's JavaScript runtime for easily building fast, scalable network applications".
To develop applications in nodejs you write some javascript and or html/css for web applications.
If wish for others to use you application you start you nodejs server and listen for incoming requests.
Summary
Despite some of the similarities a Google Chrome Extension and Nodejs have nothing to with each other. You cannot use them together in some special way outside of the normal client/server communication.
You can use a WebPack (GitHub) or Browserify (see handbook) to build web-browser extension based on the node.js code.
With Browserify, to convert your code, you can simply run:
browserify node-code.js -o node-code-out.js
Read more:
Browserify vs Webpack.
Build a Chrome Extension with Preact and Webpack (see: Preact Chrome Extension Starter).

Has any other browser apart from Chrome implemented WebRTC as of now?

Google has taken up the implementation of WebRTC in Chrome very seriously as indicated by the frequent updates in the Canary and Beta channel of Chrome. Are there any other browsers who are upto implementing this?
Firefox/IE/Opera are working on it. No word from Apple/Safari or Microsoft/IE, although IE is unlikely at best, because they're working on their own standard unfortunately. Crazier things have happened, but I wouldn't count on it. Apple has been fairly mum on the subject.
If you want support for those other browsers, we built a solution for it # Frozen Mountain (I work there) using IceLink.
Opera Mobile does offer support to WebRTC. And according to this article, Mozilla isn't all that far behind either. Ericsson Labs has their own custom browser which supports WebRTC. But it runs only on Ubuntu as of now. WebRTC itself is still under development and I'm sure that we can see complete support from all major browsers in some time.
Mozilla is far along in implementing WebRTC, and we're leading the design and implementation of DataChannels within WebRTC, as well as Identity work. We're working on a project-specific repo right now (alder), but pieces have already moved over into mozilla-central, such as initial support for getUserMedia.

Resources