User:Ark25/Scripts

From WikiProjectMed
Jump to navigation Jump to search

Feature request: Provide a list with the resulting articles

Archive 7 - https://en.wikipedia.org/wiki/Help_talk:Searching#Feature_request:_Provide_a_list_with_the_resulting_articles

I am searching for the articles that contain the string "Vales" in the title - intitle:/Vales/. The search tool finds 76 items.

My request is to provide a list with the titles of the articles found, like this:

..

I think it would be really useful for the users. It can help them in many ways. For example to introduce the list in a text file and to further refine the search, using a text editor, or for using a robot for changing text in the respective articles (for example there are 237 articles containing the string "Neamţ County" and a robot should change the text into "Neamț County" - from T-cedilla to T-comma). Thank you. —  Ark25  (talk) 21:44, 29 March 2020 (UTC)

@Ark25: I would also like this. Wikipedia:AutoWikiBrowser has the feature and can also make lists in many other ways: Wikipedia:AutoWikiBrowser/User manual#Make list. I have a crude version by placing this in Special:MyPage/monobook.css:
.searchresult {display: none;}
.mw-search-result-data {display: none;}
It hides the other lines on search results pages. If you use Vector normally then you can change a search page to display in MonoBook by adding &useskin=monobook to the url. If you have MonoBook then place it in Special:MyPage/vector.css and add &useskin=vector to the url. You can also manually apply the above css to a viewed browser window with a feature in most browsers. You can also add this to your common JavaScript:
$( document ).ready( function() {
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Search'){
  mw.util.addPortletLink(
    'p-tb',
    location.href.replace( location.hash, '' ) + ( location.search ? '&' : '?' ) + 'useskin=monobook',
    'MonoBook',
    't-monobook',
    'Repeat the search in MonoBook'
  );
}
});
On search pages it makes a "MonoBook" link under "Tools" to repeat the search in MonoBook. PrimeHunter (talk) 23:34, 29 March 2020 (UTC)
@PrimeHunter: These scripts are really great! I forgot to mention that I am not using AutoWikiBrowser; many of the users who would benefit from this feature won't have the time and patience to use AWB.
  • Do you have any link to some documentation that explains how to manually apply the above css to a viewed browser window ? I'm just curious.
Thank you! —  Ark25  (talk) 00:32, 30 March 2020 (UTC)
@Ark25: It depends on the browser. In Firefox I right-click somewhere on the page, click Inspect Element, click Edit CSS, and copy the css code to the top. PrimeHunter (talk) 00:42, 30 March 2020 (UTC)