Wikipedia API redirect request - wikipedia-api

I am using the Wikipedia API by queries like these
action=query&prop=extracts&format=jsonfm&exintro=&titles=CSS
Unlike the Wikipedia webpage, this does not automatically redirect to Cascading style sheets. I would like it to do so. Is there a way to do the same in the request ?

Use the redirects parameter: action=query&prop=extracts&format=jsonfm&exintro=&titles=CSS&redirects

Related

Wordpress widget with xml asynchronous integration

I have a task to do where I need to make calls to an external xml api to fetch data for an event calendar in the sidebar of a site. The date will be changed with JavaScript and then i need to make another call to refresh the data. Can somebody give me an idea about how to cleanly set up an action or function somewhere that I can direct an Ajax action to? It's easy to set up a widget with the correct HTML etc but where does the Ajax connect to? Ideally when the content initially loads on the page it would use the same function that the post is going to use to generate the HTML on the server side.
Any tips would be appreciated. This is an xml api...no option for json or jsonp so credentials including a token and user I'm assuming will have to go somewhere in my widget, something like a proxy function?
It sounds as if you're asking about making cross-domain AJAX requests, AKA the "same origin policy."
The same origin policy prevents document or script loaded from one origin from getting or setting properties of a document from a different origin (domain). See http://www.mozilla.org/projects/security/components/same-origin.html for a more detailed description of the policy.
See Ways to circumvent the same-origin policy for a good description of the options available to circumvent this limitation.
The short answer is that unless you have control over the domain to which you're making AJAX requests, your best bet is probably to set up a simple proxy that lives in the same domain where your AJAX is running, which will forward requests to the destination. Doing a google search on "simple AJAX proxy" will get you a host of results, including pre-built proxies in a variety of languages.

How do the Facebook like button and Google +1 button deal with a redirected url? [duplicate]

I understand the og:url meta tag is the canonical url for the resource in the open graph.
What strategies can I use if I wish to support 301 redirecting of the resource, while preserving its place in the open graph? I don't want to lose my likes because i've changed the URLs.
Is the best way to do this to store the original url of the content, and refer to that? Are there any other strategies for dealing with this?
To clarify - I have page:
/page1, with an og:url of http://www.example.com/page1
I now want to move it to
/page2, using a 301 redirect to http://www.example.com/page2
Do I have any options to avoid losing the likes and comments other than setting the og:url meta to /page1?
Short answer, you can't.
Once the object has been created on Facebook's side its URL in Facebook's graph is fixed - the Likes and Comments are associated with that URL and object; you need that URL to be accessible by Facebook's crawler in order to maintain that object in the future. (note that the object becoming inaccessible doesn't necessarily remove it from Facebook, but effectively you'd be starting over)
What I usually recommend here is (with examples http://www.example.com/oldurl and http://www.example.com/newurl):
On /newpage, keep the og:url tag pointing to /oldurl
Add a HTTP 301 redirect from /oldurl to /newurl
Exempt the Facebook crawler from this redirect
Continue to serve the meta tags for the page on http://www.example.com/oldurl if the request comes from the Facebook crawler.
No need to return any actual content to the crawler, just a simple HTML page with the appropriate tags
Thus:
Existing instances of the object on Facebook will, when clicked, bring users to the correct (new) page via your redirect
The Like button on the (new) page will still produce a like of the correct object (but at the old URL)
If you're moving a lot of URLs around or completely rewriting your URL scheme you should use the new URLs for new articles/products/etc, but you'll need to keep the redirect in place if you want to retain likes, comments, etc on the older content.
This includes if you're changing domain.
The only problem here is maintaining the old URL -> new URL mapping somewhere in your code, but it's not technically difficult, just an additional thing to maintain in the future.
BTW, The Facebook crawler UA is currently facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)
I'm having the same problem with my old sites. Domains are changing, admins want to change urls for seo etc
I came to conclusion its best to have some sort uniqe id in db just for facebook - from the beginning. For articles for example I have myurl.com/a/123 where 123 is ID of the article.
Real url is myurl.com/category/article-title. Article can then be put in different category, renamed etc with extensive logic for 301 redirects behind it. But the basic fb identifier can stay the same for ever.
Of course this is viable only when starting with a fresh site or when implementing fb comments for the first time.
Just an idea if you can plan ahead :) Let me know what you think.

Do Google and Bing crawlers treat hash tags in URLs as GET parameters?

Crawlers in genereal consider http://server/page and http://server/page?parameter=1 two different URLs.
How do Google and Bing crawler consider hash tag URLs, such as http://server/page#hash?
According to http://www.tynt.com/support/faq#technical everything after the hash tag is ignored. Are there other sources confirming this?
Your source is correct. Everything after the hash tag (aka URL fragment) is typically ignored. The reason being, the URL fragment is typically only used by the browser and doesn't cause additional information to be pulled from the server. So the content of the page should largely stay the same.
For instance, the hash parameter is typically used in 2 ways, either as a page anchor (think 'go to top of page') or as ways of passing information via javascript.
The exception to the rule is the AJAX crawlability implementation. In this case if you have a "hash-bang" (#!), Google and Bing (maybe) will attempt to crawl your AJAX content, which will treat your hash parameter values as separate pages.
Google => "Making AJAX Applications Crawlable"
Search Engine Land => Bing Now Supports Google’s Crawlable AJAX Standard?
This strictly depends on the concrete crawler implementation, there is no general rule enforcing any behavior.
Maybe there is an update to this question.
See this link:
http://www.seorigami.org/google-jump-to-links/
A Hash Link may not affect your ranking but the display of results.

Removing URL duplicates when using pretty urls

I'm using pretty URLs in my web app, one example is 'forum/post/1' which invokes PostController in Forum module, which loads a post with id=1. This is what I need but that post is also accessible from 'forum/post/view/id/1'. That's bad, because search crawlers don't like when same page is accessible from several URLs, right?
I'm using Yii framework which supports 'useStrictParsing' option, which tells that incoming request must match at least one "pretty" route, otherwise request fails with 404. However it's not a perfect solution, because I don't have pretty URLs for every controller/action.
Ideally, framework should redirect 'forum/post/view/id/1' to 'forum/post/1' with a 301 status code. How did you solve this problem? It's not Yii/PHP specific question, how does your framework/tool deal with it?
The best way to make sure search engines only rank one page the pretty url over another, if there are multiple ways to view the content is to your a canonical tag within the header of your document
<link rel="canonical" href="http://www.mydomain.com/nice-url/" />
This is very useful with windows based system as IIS is not case sensitive with its web pages but the web standard is case sensitive.
So
www.maydomain.com/Newpage.aspx
www.maydomain.com/newpage.aspx
www.maydomain.com/NEWPAGE.aspx
These are all seen by Google as different pages, and you are then marked down for having a site with duplicate content, but not so with a canonical as each page in the case above would have the same canonical meta tag and the that url is the only one which will be used by the search engines.
Provided that no one links to your non-pretty urls, the search engines will never know that they exist.
If you do want to eliminate them, you could bypass your web framework by adding an alias in you web server's configuration file; the url will be redirected before it ever reaches the framework.
Frameworks like Django, which don't provide 'magic' routing, don't face this issue, the only routes which exist are those which you define manually. In it's case, you could define a view for the non-pretty url which returns the appropriate redirect.

Page contains multiple canonical issues

i am using ISS SEO toolkit to analyze our website. Form that i got 450 canonical issues. all the errors in the same format as follows:
The page with URL "http://dynamicsexchange.com/images/Logoscroll/Images/511201091716pm_a.jpg" can also be accessed by using URL "http://www.dynamicsexchange.com/images/Logoscroll/Images/511201091716pm_a.jpg".Search engines identify unique pages by using URLs. When a single page can be accessed by using any one of multiple URLs, a search engine assumes that there are multiple unique pages. Use a single URL to reference a page to prevent dilution of page relevance. You can prevent dilution by following a standard URL format.
Please help me to solve these problems with examples. and i am using masterpage concept.
i am using IIS web server please give me the solution to set the 301 redirect (i am using master page concept) with example
Choose whether you want your visitors to use http://dynamicsexchange.com or http://www.dynamicsexchange.com. Then set up a 301 redirect to redirect any traffic from the one you don't want to the one you do want.
That way any traffic which accidentally links to the wrong one will be redirected to the right one. Search engines will then record all links to the right one, and so your page rank won't be diluted.
How to set up the 301 redirect will depend on what your web server is.