Javascript to find other articles having the same external link

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Javascript to find other articles having the same external link

Lars Aronsson
By putting the following code (written by User:EnDumEn) in
user:YOURNAME/common.jsany external link gets an extra little
symbol (⎆), which leads to a link search for that link. This
is very useful for finding other articles that cite the same
source.


jQuery( "a.external" ).after( function() {
return jQuery( "<a>⎆</a>)" )
.attr( "href", "//sv.wikipedia.org/wiki/Special:Linksearch/" + this.href )
.before( " " );
});



--
   Lars Aronsson ([hidden email])
   Aronsson Datateknik - http://aronsson.se



_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Javascript to find other articles having the same external link

Gerard Meijssen-3
Hoi,
With sources stored in Wikidata finding where the same source is used as
well is implicit. This is a hack, admittedly a nice hack/.
Thanks,
    GerardM


On 26 August 2013 09:27, Lars Aronsson <[hidden email]> wrote:

> By putting the following code (written by User:EnDumEn) in
> user:YOURNAME/common.jsany external link gets an extra little
> symbol (⎆), which leads to a link search for that link. This
> is very useful for finding other articles that cite the same
> source.
>
>
> jQuery( "a.external" ).after( function() {
> return jQuery( "<a>⎆</a>)" )
> .attr( "href", "//sv.wikipedia.org/wiki/**Special:Linksearch/<http://sv.wikipedia.org/wiki/Special:Linksearch/>"
> + this.href )
> .before( " " );
> });
>
>
>
> --
>   Lars Aronsson ([hidden email])
>   Aronsson Datateknik - http://aronsson.se
>
>
>
> ______________________________**_________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/**mailman/listinfo/wikitech-l<https://lists.wikimedia.org/mailman/listinfo/wikitech-l>
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Javascript to find other articles having the same external link

Ole Palnatoke Andersen-2
I'd love to see a similar thing for articles linking to the same book via
ISBN.

regards,
Ole


On Mon, Aug 26, 2013 at 9:46 AM, Gerard Meijssen
<[hidden email]>wrote:

> Hoi,
> With sources stored in Wikidata finding where the same source is used as
> well is implicit. This is a hack, admittedly a nice hack/.
> Thanks,
>     GerardM
>
>
> On 26 August 2013 09:27, Lars Aronsson <[hidden email]> wrote:
>
> > By putting the following code (written by User:EnDumEn) in
> > user:YOURNAME/common.jsany external link gets an extra little
> > symbol (⎆), which leads to a link search for that link. This
> > is very useful for finding other articles that cite the same
> > source.
> >
> >
> > jQuery( "a.external" ).after( function() {
> > return jQuery( "<a>⎆</a>)" )
> > .attr( "href", "//sv.wikipedia.org/wiki/**Special:Linksearch/<
> http://sv.wikipedia.org/wiki/Special:Linksearch/>"
> > + this.href )
> > .before( " " );
> > });
> >
> >
> >
> > --
> >   Lars Aronsson ([hidden email])
> >   Aronsson Datateknik - http://aronsson.se
> >
> >
> >
> > ______________________________**_________________
> > Wikitech-l mailing list
> > [hidden email]
> > https://lists.wikimedia.org/**mailman/listinfo/wikitech-l<
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>



--
http://palnatoke.org * @palnatoke * +4522934588
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Javascript to find other articles having the same external link

Gerard Meijssen-3
Hoi,
<grin> the same book or also the same book in translation? </grin>
Can be theoretically be linked in Wikidata too.
Thanks,
     GerardM


On 26 August 2013 10:07, Ole Palnatoke Andersen <[hidden email]> wrote:

> I'd love to see a similar thing for articles linking to the same book via
> ISBN.
>
> regards,
> Ole
>
>
> On Mon, Aug 26, 2013 at 9:46 AM, Gerard Meijssen
> <[hidden email]>wrote:
>
> > Hoi,
> > With sources stored in Wikidata finding where the same source is used as
> > well is implicit. This is a hack, admittedly a nice hack/.
> > Thanks,
> >     GerardM
> >
> >
> > On 26 August 2013 09:27, Lars Aronsson <[hidden email]> wrote:
> >
> > > By putting the following code (written by User:EnDumEn) in
> > > user:YOURNAME/common.jsany external link gets an extra little
> > > symbol (⎆), which leads to a link search for that link. This
> > > is very useful for finding other articles that cite the same
> > > source.
> > >
> > >
> > > jQuery( "a.external" ).after( function() {
> > > return jQuery( "<a>⎆</a>)" )
> > > .attr( "href", "//sv.wikipedia.org/wiki/**Special:Linksearch/<
> > http://sv.wikipedia.org/wiki/Special:Linksearch/>"
> > > + this.href )
> > > .before( " " );
> > > });
> > >
> > >
> > >
> > > --
> > >   Lars Aronsson ([hidden email])
> > >   Aronsson Datateknik - http://aronsson.se
> > >
> > >
> > >
> > > ______________________________**_________________
> > > Wikitech-l mailing list
> > > [hidden email]
> > > https://lists.wikimedia.org/**mailman/listinfo/wikitech-l<
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l>
> > _______________________________________________
> > Wikitech-l mailing list
> > [hidden email]
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> >
>
>
>
> --
> http://palnatoke.org * @palnatoke * +4522934588
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Javascript to find other articles having the same external link

Mark Holmquist-2
In reply to this post by Ole Palnatoke Andersen-2
On Mon, Aug 26, 2013 at 10:07:16AM +0200, Ole Palnatoke Andersen wrote:
> I'd love to see a similar thing for articles linking to the same book via
> ISBN.

You can do that in the JavaScript just by adding to the selector at the
beginning, and you can also get other magic links at the same time.

jQuery( "a.external, a.mw-magiclink-isbn, a.mw-magiclink-pmid, a.mw-magiclink-rfc" ).after( function() {
  return jQuery( "<a>" )
    .text( '⎆' )
    // Shorter, relative link (could also use mw.Title here maybe)
    .attr( "href", "/wiki/Special:Linksearch/" + this.href )
    .before( " " );
} );

But it looks like Special:Linksearch doesn't support searching for magic
links, at least not yet. So I'm afraid this is all for nought.

I'm going to hope that CirrusSearch will fix this in some capacity, since
it looks pretty simple to fix, and if Chad would like some help with that,
he knows where to find me...

--
Mark Holmquist
Software Engineer, Multimedia
Wikimedia Foundation
[hidden email]
https://wikimediafoundation.org/wiki/User:MHolmquist

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Javascript to find other articles having the same external link

Brian Wolff
On 2013-08-26 8:55 AM, "Mark Holmquist" <[hidden email]> wrote:
>
> On Mon, Aug 26, 2013 at 10:07:16AM +0200, Ole Palnatoke Andersen wrote:
> > I'd love to see a similar thing for articles linking to the same book
via
> > ISBN.
>
> You can do that in the JavaScript just by adding to the selector at the
> beginning, and you can also get other magic links at the same time.
>
> jQuery( "a.external, a.mw-magiclink-isbn, a.mw-magiclink-pmid,
a.mw-magiclink-rfc" ).after( function() {

>   return jQuery( "<a>" )
>     .text( '⎆' )
>     // Shorter, relative link (could also use mw.Title here maybe)
>     .attr( "href", "/wiki/Special:Linksearch/" + this.href )
>     .before( " " );
> } );
>
> But it looks like Special:Linksearch doesn't support searching for magic
> links, at least not yet. So I'm afraid this is all for nought.
>
> I'm going to hope that CirrusSearch will fix this in some capacity, since
> it looks pretty simple to fix, and if Chad would like some help with that,
> he knows where to find me...
>
> --
> Mark Holmquist
> Software Engineer, Multimedia
> Wikimedia Foundation
> [hidden email]
> https://wikimediafoundation.org/wiki/User:MHolmquist
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l

For reference that's https://bugzilla.wikimedia.org/show_bug.cgi?id=49537

Arguably they aren't really external links and shouldn't be tracked with
them, otoh a table just for magic links seem overkill.

-bawolff
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Javascript to find other articles having the same external link

Daniel Friesen-2
On 2013-08-26 8:06 AM, Brian Wolff wrote:

> On 2013-08-26 8:55 AM, "Mark Holmquist" <[hidden email]> wrote:
>> On Mon, Aug 26, 2013 at 10:07:16AM +0200, Ole Palnatoke Andersen wrote:
>> ...
>> But it looks like Special:Linksearch doesn't support searching for magic
>> links, at least not yet. So I'm afraid this is all for nought.
>>
>> I'm going to hope that CirrusSearch will fix this in some capacity, since
>> it looks pretty simple to fix, and if Chad would like some help with that,
>> he knows where to find me...
>>
>> --
>> Mark Holmquist
>> Software Engineer, Multimedia
>> Wikimedia Foundation
>> [hidden email]
>> https://wikimediafoundation.org/wiki/User:MHolmquist
> For reference that's https://bugzilla.wikimedia.org/show_bug.cgi?id=49537
>
> Arguably they aren't really external links and shouldn't be tracked with
> them, otoh a table just for magic links seem overkill.
>
> -bawolff
Maybe we can fit them into page_props somehow.

Did we have support for 1:many instead of just 1:1 keys in page_props?

~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]


_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l