I am looking for a web service kind of like Google Analytics.
Paste some javascript into your web page and if any of the links there become invalid, hey presto, an email is sent to someone telling them which link, which page etc etc has the incorrect link.
Anyone heard of such a service?
This would slow the page loading down a lot if it had to check for broken links every time someone visited it (basically a http request for every link). Not that it isn't possible, but the implementation would have to be very very good.
Javascript cannot send emails, you would have to use ajax to post the details to another page that would then email the admin. As this is all client side, it is very open to abuse.
I would suggest using a program to do it every now and again. There are even Firefox extensions to do it rather than a program. Google will also list a whole host of websites offering the service.
Related
I noticed today in the webserver logs that we sometimes get bursts (450 requests in 2 seconds) of requests from a useragent with Google Web Preview. Looking at other stackoverflow it seems this is probably related to the preview functionality on the search page or maybe to the saved/most used links at the bottom of a users chrome tabs.
I've already blocked these particular URLs in the robots.txt, so, it's obviously ignoring that. It seems from this 2010 instant previews page that you can add a nosnippet tag and Google will then not try to fetch the preview. However, it seems that adding nosnippet wouldn't actually stop the request (as they'd still have to fetch the page to parse out the tag).
Short of blocking Google's ip address which I don't want to do, is there a decent way to stop Google hammering the server periodically.
I think you probably did it, but when I get such issue I make a buffer page, and provide link on that page e.g link for admin panel that I don't want to be rendered and use NO Index on that page
I came accross to a situation where Firefox in incognito mode blocks some of the cookies on my site. More specifically google analytics cookies like _ga, _gid, ..etc. Searching in the internet I came across to this article. So browsers like Firefox somehow identify these cookies as tracking. But how? How does it know which cookies are tracking and which not? I need to know this because next time I set cookies on my server I dont want them to be blocked by browsers.
In context of the article it just means blocking reference links. For instance it blocks sending the referral information from, for instance Facebook, to other sites.
Other sites use the referral information to decide who to pay to get more traffic and stuff like that.
There's like 100 different versions of the idea of "tracking" though.
Like the article points out, your ISP always know every DNS search you do and every call to an IP so they always know ALLLL your traffic and are "tracking" it.
There's also "ad tracking" where all those google calls send out what the crawler says is on the page in order to create targeted ads and all that.
I think, based on what you wrote, you're just talking about tracking links which is just scrubbing the referral link part though.
You'd have to be more specific if that's not what you're looking at.
I've learned that you shouldn't be using GET requests for URLs that modify information on the server because you could get problems with browser link prefetch, search engine crawlers etc.
But when I'm viewing the source code for some sites I saw that many big companies doesn't use this approach.
For example: I signed up for tidal.com and activated a subscription.
When I went to the subscript page I got a page where I was able to cancel my subscription. But the button "cancel my subscription" is not a form performing a POST request, but simply a link to https://my.tidal.com/br/account/subscription/cancel
as well reactivate subscription is a link to https://go.tidal.com/br/account/subscription/resume/40cd9e3e-3d58-4c80-aee7-c378011b49d4
Why are they doing that if my action is modifying information on the server?
I'm looking to do the following:
I have a device that receives data from a website, in this case to light up an LED. However, I would like to do the reverse now, where I can click a physical button on the device (to trigger code) and send a message to display on the website. The website itself is just simple HTML, and I'm using the ESP8266 to send the data over wifi, programmed using arduino code and the WebSocketServer library. I'm not quite sure how to get a message across, nor how to actually display it within the website. I apologize if this is quite easy, but I'be been wracking my head for two hours trying to find it online, and have had no luck. Cheers!
In reference to http://www.instructables.com/id/Arduino-Esp8266-Post-Data-to-Website/ blog by Khalilm , It seems to be much easy for accomplishing your aim.He explains it in six steps.
HTTP works as a request-response protocol between a client and server. A web browser may be the client, and an application on a computer that hosts a web site may be the server. Example: A client (browser) submits an HTTP request to the server; then the server returns a response to the client. The response contains status information about the request and may also contain the requested content. On our example the esp8266 is the client and the server that is hosting our website is the server.
Because HTTP is a request-response protocol, as mentioned above, it's not really about "sending" anything to a browser, but rather of making it available to the browser when someone visits the page, the page is reloaded, or the page "reaches out" to the server with a webservice call, for example, to update part of the page.
However, one twist you could do on your project is:
1. Press the button
2. Record the time in millis() for example.
3. Create a small webpage to show "Button was last pressed at ___ millis()"
4. Then press button whenever you like and refresh the page to see updated time.
Beyond that, you'll need scripting on the browser side to poll the webserver. Given that you don't really ever "send" to a website, does this idea make sense, a reasonable derivative of what you were attempting? If so, give it a try and we'll help if you run into problems.
I am facing a scenario where live Twilio call gets dropped, if the browser window in which call is received is reloaded. Is there a way to overcome this set-back without affecting the live calls?
Twilio Evangelist here.
Based on your question, I assume you are using the Twilio Client JavaScript SDK? If that is indeed the case, then unfortunately, if the page thats hosting the SDK gets reloaded the connection between the browser and Twilio will drop since the browser is reloading everything, including the JavaScript SDK.
There are a couple of different techniques I can think of off the top of my head that you can use to help avoid page reloads, and another idea that could help you recover a call where the connection to the browser has dropped because of a page reload. A lot of this is going to depend on your specific app and the experience you are trying to create for your users.
So to help avoid having to reload the page:
1) Use AJAX requests to your server in order to avoid page reloads. If your page includes content like a form, or you want to update the page content with data form the server, you can look using AJAX requests to the server instead of a normal full page postback to submit the form, or to retrieve the data form the server. This would help in avoiding having to reload the entire page in those two scenarios.
2) Use an iFrame to host your page content, and then put the Twilio SDK in the parent page (the one that defined the iFrame). This would let you reload the content hosted in the iframe, without having to reload the entire host page, avoiding a reload the the Twilio library. The downside to this is that communicating between content in an iframe and its host can get really messy fast.
Neither of these two techniques is fool-proof. Obviously a user can always just hit the refresh button on their browser, and thats going to cause the connection to drop.
In a case where the page does get reloaded, and the connection from Twilio to the browser gets dropped, one idea is to leverage Twilios capability to help reconnect the caller together. When a user calls your twilio phone number, instead of connecting them directly to the Twilio Client running in the browser (by dialing a client with <Client>), instead dial that caller into a conference <Conference>, and then have the browser client connect into that same conference. The benefit to that is if the browser disconnects, the original caller won't get hung up on, they will still be sitting in the conference room. As long as you've saved the Conference SID or name, you can have the browser client reconnect to that conference.
Hope that helps point you in the right direction.