trying to implement facebook and google plus icon in my website - asp.net

For face book and Google Plus I am getting 407 and 403 result code. I used the below URL for generating face book share and Google plus icon
http://www.google.com/webmasters/+1/button/
http://developers.facebook.com/docs/reference/plugins/like/
Can someone suggest me what I am missing
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3)
Timestamp: Thu, 12 Jan 2012 18:20:17 UTC
Message: Object doesn't support this property or method
Line: 4
Char: 1
Code: 0
URI: https://connect.facebook.net/en_US/all.js#xfbml=1
Message: Permission denied
Line: 1
Char: 8164
Code: 0
URI: https://platform.twitter.com/widgets/tweet_button.1324331373.html

The page you are Liking or plus 1'ing probably is not accessible to the linters being used (meaning it is not a public URL). For facebook you can quickly determine the status of your URL by linting it at: https://developers.facebook.com/tools/lint

Related

web scraping / web crawling showing 403 error on the site i want to crawl

import requests
from bs4 import BeautifulSoup
url ='https://www.vesselfinder.com/vessels'
headers= {'User-Agent': 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)'}
response = requests.get(url)
soup = BeautifulSoup(response.content, 'html.parser')
response.status_code
i tried different user agent but still not working, i tried other sites it work but this website not working, help me to crawl all vessel data from this site. thanks in advance!!!
Server wants an additional header for language
import requests
headers = {
'user-agent': 'Mozilla/5.0',
'accept-language': 'en-GB,en-US;q=0.9,en;q=0.8',
}
response = requests.get('https://www.vesselfinder.com/vessels', headers=headers)
response.status_code

if-modified-since not functioning as expected in Azure Web App

I have a angular 1.x SPA app built with ASP Web API hosted in Azure as a Web App. When I deploy new code browsers such as Chrome (not edge or IE) fail to get the new code based on If-modified-since or ETAG. The current workaround is to have users do a CTRL + F5 to force a download. There are some differences in the request headers between Edge and Chrome that may explain this but I am not very familiar with the cache control mechanisms within HTTP.
My main question is this an expected behavior and I need to deliberately detect this in client side code and force a refresh or is this something IIS is expected to handle by default? Secondarily is this something I can solve through changes to web.config?
Edge
Accept: application/javascript, /; q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: en-US
Connection: Keep-Alive
Cookie: ai_user=T9jXc|2016-08-08T05:44:23.776Z; ai_session=2GcvV|1470765398272|1470765399564
Host: app.somehost.com
If-Modified-Since: Mon, 08 Aug 2016 16:34:46 GMT
If-None-Match: "0172c692f1d11:0"
Referer: https://app.somehost.com/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393
Chrome
Accept:/
Accept-Encoding:gzip, deflate, sdch, br
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Cookie:ai_user=WXgAN|2016-08-09T16:28:50.251Z; ai_session=nV7TD|1470765376324|1470765376960
Host:app.somehost.com
If-Modified-Since:Mon, 08 Aug 2016 16:34:46 GMT
If-None-Match:"0172c692f1d11:0"
Referer:https://app.somehost.com/
User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
The issue was resolved by optimizing bundles. I had optimizations off as it was breaking dependencies that didn't not support minification. To fix the issue I removed the offending .js files from the bundles and references them directly. Then enabled optimizations in BundleConfig.cs
BundleTable.EnableOptimizations = true

nginx proxy_pass solution needed

Im trying to achieve the follwoing -
While browsing to my nginx web-server with the following url - http://server/?device=10.10.21.102
I want proxy_pass=http://10.10.21.102 to be set and get the content of 10.10.21.102.
I've managed work it out with $arg_device but when destination page has images it breaks -
[09/Mar/2014:22:08:22 +0200] "GET /welcome.png HTTP/1.1" 500 594 "http://server/?device=10.10.21.102/" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 1.1.4322; InfoPath.3; Tablet PC 2.0; .NET4.0C)" "-"
When I access http://server/?device=10.10.21.102/welcome.png - I can see the image.
What would be the easiest way to solve this so css,js,images will be called as:
GET /?device=10.10.21.102/welcome.png
and not just
"GET /welcome.png
Thanks!
I've managed to solve this, with nginx_substitutions_filter module (http://wiki.nginx.org/HttpSubsModule)
It's very easily done.

Webpage error in ie8 asp.net

Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)
Timestamp: Wed, 23 Jan 2013 05:01:55 UTC
Message: Object expected
Line: 62
Char: 1
Code: 0
URI: http://localhost:4001/abc.aspx?id=12
I am getting this error in every page and specifically in ie8 . My script that is causing the issue is
<script type="text/javascript">DM_redirect("http://mobile.dudamobile.com/site/abc"); </script>
It works perfectly on both Google Chrome and Mozilla
How do i get rid of this issue
The Script being used is this
http://static.dudamobile.com/DM_redirect.js
I had a similar issue some weeks ago. You basically have to specify "javascript" in language because IE8 will read something else.
At last that worked for me.

Where to get this browser info?

I'm working on some logging functionality for a website, and I need to update a table with information about the users' browser info. The table was created a while ago by someone else, and I have no idea where they were getting this info. Does anyone recognize this? (each line is a single row)
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB0.0; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; FunWebProducts; FBSMTWB; SIMBAR={8FCFDD51-4B26-489E-A39E-AB2744B
Java/1.6.0_06
Opera/9.80 (Windows NT 5.1; U; en) Presto/2.5.24 Version/10.53
BlackBerry9630/4.7.1.61 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/105
It's in the HTTP User-Agent header.
Here is the code you would use in ASP.
Dim sAgent: sAgent = Request.ServerVariables("HTTP_USER_AGENT")

Resources