sharing my page URL on twitter via twitter share button - asp.net

I have a problem using twitter share button on my asp.net page.The problem is that when I click on the share button i want it to share the URL of my page which the share button exists for example "http://localhost:1349/Pages/Share/ShareRedeemtion.aspx?UID=2&GiftID=1&MID=2 via#QhatAPP" but for some reason which i can't figure the button only share the title of the page, I'm confused is there is a problem with twitter share button to share URLs which contains a query string? and if do exists a problem is there any way enables me to share my URL on twitter via twitter share button?

You appear to have 2 problems:
You need to encode the URL you are passing in because, yes, it has a querystring on it. Check out URLEncode if you need to.
It also doesn't appear to work with non-publicly accessible Urls (your localhost in the sample). It may be doing some sort of callback to check that the Url is accessible or checking for Spam.
A sample that works with a querystring.
https://twitter.com/share?url=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F8190644%2Fsharing-my-page-url-on-twitter-via-twitter-share-button%3Ftemp%3D1&text=Test+Link
For more information and properties for the button, check https://dev.twitter.com/docs/tweet-button

Related

Can't get a value from an URL parameter

I'm trying to integrate the Google+ API in my web application which is developed in Angular2 so I can login to the home page using my Google account credentials and without the need to create a new account. I made a clickable html link that has the following href
https://accounts.google.com/o/oauth2/v2/auth?response_type=code&client_id=**********.apps.googleusercontent.com&scope=email&redirect_uri=http://localhost:3000/home
Once clicking on it, it demands for permission through my google account and when i authorize, it redirect me to the http://localhost:3000/home?code=4 the problem is that I need the whole code's value so that I can use it to get the Access Token but I don't know why the value appeared then it went hidden in less than a second and just keeping the first letter of the code (which is 4 in this case). The problem that if I go back to the previous page of the browser it will appear again.
Any help please? Or Is there any Function in Angular2 that tells the browser to go back to the previous page so I can get the whole code ?

Adding Google's standard search (not custom) to my website

My intention is to embed Google results in my website. I don't want to customise the domain/s on which the search is performed or anything, just a 'bog standard' Google search based on search parameters I pass it.
2 questions:
How do I display google results on my website as a response to search criteria entered into a textbox I have?
Is there any legislation I need to take into account?
I know my second question sounds rather strange but I'm aware that what I'm appearing to do here is present content driven by Google as though it's my own so want to avoid breaching any copyright or 'same-origin policy' type thing.
What I've Tried/Ways I Know I Could Achieve This
Screen scraping Google's response to a simple web request with the necessary query parameters (but seems a bit excessive)
Google's custom search (but I don't want to customise anything)
I've tagged this question for some more context.
As it is mentioned here
you can use your own XML parser to customize the display for your
search users.
with an http request like this:
GET /search?q=bill+material&output=xml&client=test&site=operations
But it has a limitation on number of requests per day, 500 or 1000 I guess.
Custom Search can be configured to include the entire Web in its results:
From the Google Custom Search homepage, click New search engine.
In the Sites to Search box, enter at least one valid URL (e.g. www.google.com).
Click Create.
On the next page, under Optional next steps, click Edit.
On the Basics tab, under Search Preferences, select Search the entire web but emphasize included sites.
Click Save Changes.
In the left-hand menu, under Control Panel, click Sites.
Delete the site you entered during the initial setup process.

how can i remove the social bookmark plugin using html or javascript

sory guys, click the first link you will see the image i been mark by red, after you click the second link, you will see the arrow.
1) http://s261.beta.photobucket.com/user/minaekoz/media/satu.png.html
2) http://s261.beta.photobucket.com/user/minaekoz/media/satua.png.html
Question :
That is social bookmarking site i use to promote my blog but i want to remove the plugin after somebody click that link in the first image.
how can i remove that plugin in the second image after user click the link at the first image?
*sory if my english so bad
I'm not sure how your page is embedded, I guess it's done using frames or an iframe? This would be important to know, but you'll most likely be able to use some javascript code like this (called in some element's onload event (e.g. <body>):
if (window.top != window.self)
window.top.location.replace(window.self.location.href);
I think you can add it through using a custom BlogSpot template or maybe with some of the widgets as well.
Probably you can't. That social bookmarking site will probably open your website in an IFRAME, and therefore, clicks in your page cause IFRAME navigation, and not browser navigation.
Since your site, and the IFRAME site are different, the javascript in your site cannot access the DOM (Document Object Model) in the other site because SOP (Same Origin Policy).
You can disallow that your website run in IFRAMEs by using the X-Frame-Options http header though, but I would leave it like that.
Cheers.

Will Googlebot follow _escaped_fragment_ HTTP redirect?

I have an ajaxified website, and I want all my content to be crawlable. I have a photo gallery, which only loads the photo using ajax, without refreshing the whole page. My root URL is this:
http://mysite/photos
and whenever a photo thumbnail is clicked, it displays the photo, and hash becomes #!/photo/photoid/phototitle, or when you are searching for a criteria, it becomes #!/photos/f-number/1.8/iso/640 e.g. for searching for photos with f/1.8 at ISO 640 (and more criteria can be appended this way). When a user opens up a URL like http://mysite/photos/#!/photos/f-number/1.8/iso/640 the landing page, using a javascript, will redirect the user to http://mysite/photos/f-number/1.8/iso/640 (without the hashbang), and again, there, the page loads http://mysite/Dynamic/PhotoThumbnails.aspx?f-number=1.8&iso=640 using ajax (yes, javascript looks at the location path and parses it according to that format). For the first case (link of a photo itself rather than a search), using again, only javascript, the page loads the photo itself (along with some extra tables showing technical info about photo) from the url http://mysite/Dynamic/RenderPhoto.aspx?ID=123 (where 123 the ID of the photo).
Given this information, my problem is simple: I am planning to (on my masterpage load event) redirect all requests with _escaped_fragment_s to the appropriate RenderPhoto or PhotoThumbnails page, by parsing the _escaped_fragment_ at server side. Will that work? My main concerns are;
Will Google follow the HTTP redirect? (301 or 302)
Will I get into any trouble (such as being removed from index) as I am not showing the exact same content to Google? (a browser will load a side mavigation bar, and all those fancy css styles visually-nice-looking page etc. and then load the real content into a pane at that page, where Google will be getting the "true" content only. My base page, sidebar content thumbnail list page, and photo renderer are COMPLETELY different pages which implement their OWN logic, so I cannot ever merge them)
If there is a risk of being removed due to the reasons above, what are my alternatives (no, I cannot merge the pages, it is NOT an option)? Do you recommend taking regular snapshots of pages and cache them and sending those to Googlebot?
Here is the current BETA of my website (yeah I know about lots of bugs), just to give you the idea how it will work: http://canpoyrazoglu.com/photos
I'm on ASP.NET 4.0, and using jQuery, if it helps.
A new answer to an old question. Yes it will follow it. However you may end up with both the clean and #! URLs. However, check this out (from Google Developer Guides):
Note that if you use a permanent (301) redirect, the url shown in our
search results will typically be the target of the redirect, whereas
if a temporary (302) redirect is used, we'll typically show the #! url
in search results.
This is the Google Developer Guide link:
https://developers.google.com/webmasters/ajax-crawling/docs/faq#redirects
Yes, I'm pretty sure it will follow a redirect. The Facebook open graph debugger does, and this blog post advocates implementing redirects: http://www.yearofmoo.com/2012/11/angularjs-and-seo.html

Track ad link clicks but maintain SEO-friendly links?

I have a web site that spits out links to third party sites. Now these third parties want MY site to track their clicks. How do I do this without ruining the SEO-friendly nature of a plain link?
Currently an ad link is just an anchor:
Come Visit Site A!
I can easily change the links to something like this:
http://mysite.com/clicktracker.aspx?redirect=adsiteA.com
But won't that kill any search engine benefits of linking to their site? If not, I'll happily do it this way... What are my other options? An onmousedown script that hijacks the click and does a postback then redirect?
Do your third party sites want you to report on all the bots and spiders that have crawled your site and followed the links, or just "real" people?
If it's the latter, you could do something along the lines that google use for their search results.
Basically, you render the link out normally, but add an OnMouseDown event to it, so that a spider that doesn't use a mouse follows the standard link, but a normal browser will fire the JS event first.
What you would end up with is something like this:
<a onmousedown="return trackMe(this)" href="http://example.com/">
And the trackMe method is then performing the redirect to the tracking page, which then issues a 302 redirect to the third party site.
You'd obviously want to check how this works for users navigating via the keyboard or similar (i.e. using Space or Return to follow the links).
If they're paid links, Google says they're not supposed to benefit your advertiser's PageRank. (In fact you could get penalized for trying to subvert this)
http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=66736

Resources