With data-client added as library module (#3656)

* With data-client added as library module

* Fix build
This commit is contained in:
Vivek Maskara 2020-04-15 03:00:13 -07:00 committed by GitHub
parent 9ee04f3df4
commit 32ee0b4f9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
258 changed files with 34820 additions and 2 deletions

View file

@ -0,0 +1,71 @@
package org.wikipedia;
import androidx.annotation.NonNull;
import org.wikipedia.dataclient.Service;
import org.wikipedia.dataclient.SharedPreferenceCookieManager;
import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.dataclient.okhttp.TestStubInterceptor;
import org.wikipedia.dataclient.okhttp.UnsuccessfulResponseInterceptor;
import org.wikipedia.login.LoginResult;
import okhttp3.OkHttpClient;
public class TestAppAdapter extends AppAdapter {
@Override
public String getMediaWikiBaseUrl() {
return Service.WIKIPEDIA_URL;
}
@Override
public String getRestbaseUriFormat() {
return "%1$s://%2$s/api/rest_v1/";
}
@Override
public OkHttpClient getOkHttpClient(@NonNull WikiSite wikiSite) {
return new OkHttpClient.Builder()
.addInterceptor(new UnsuccessfulResponseInterceptor())
.addInterceptor(new TestStubInterceptor())
.build();
}
@Override
public int getDesiredLeadImageDp() {
return 0;
}
@Override
public boolean isLoggedIn() {
return false;
}
@Override
public String getUserName() {
return null;
}
@Override
public String getPassword() {
return null;
}
@Override
public void updateAccount(@NonNull LoginResult result) {
}
@Override
public SharedPreferenceCookieManager getCookies() {
return null;
}
@Override
public void setCookies(@NonNull SharedPreferenceCookieManager cookies) {
}
@Override
public boolean logErrorsInsteadOfCrashing() {
return false;
}
}

View file

@ -0,0 +1,10 @@
package org.wikipedia;
import java.util.concurrent.TimeUnit;
public final class TestConstants {
public static final int TIMEOUT_DURATION = 5;
public static final TimeUnit TIMEOUT_UNIT = TimeUnit.SECONDS;
private TestConstants() { }
}

View file

@ -0,0 +1,35 @@
package org.wikipedia;
import java.util.concurrent.CountDownLatch;
public class TestLatch {
private final CountDownLatch latch;
public TestLatch() {
this(1);
}
public TestLatch(int count) {
latch = new CountDownLatch(count);
}
public long getCount() {
return latch.getCount();
}
public void countDown() {
latch.countDown();
}
public void await() {
boolean done = false;
try {
done = latch.await(TestConstants.TIMEOUT_DURATION, TestConstants.TIMEOUT_UNIT);
} catch (InterruptedException ignore) { }
if (!done) {
throw new RuntimeException("Timeout elapsed.");
}
}
}

View file

@ -0,0 +1,54 @@
package org.wikipedia.captcha;
import com.google.gson.stream.MalformedJsonException;
import org.junit.Test;
import org.wikipedia.test.MockRetrofitTest;
import io.reactivex.Observable;
import io.reactivex.observers.TestObserver;
public class CaptchaClientTest extends MockRetrofitTest {
@Test public void testRequestSuccess() throws Throwable {
enqueueFromFile("captcha.json");
TestObserver<CaptchaResult> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.getCaptchaId().equals("1572672319"));
}
@Test public void testRequestResponseApiError() throws Throwable {
enqueueFromFile("api_error.json");
TestObserver<CaptchaResult> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(Exception.class);
}
@Test public void testRequestResponseFailure() {
enqueue404();
TestObserver<CaptchaResult> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(Exception.class);
}
@Test public void testRequestResponseMalformed() {
enqueueMalformed();
TestObserver<CaptchaResult> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(MalformedJsonException.class);
}
private Observable<CaptchaResult> getObservable() {
return getApiService().getNewCaptcha()
.map(response -> new CaptchaResult(response.captchaId()));
}
}

View file

@ -0,0 +1,53 @@
package org.wikipedia.createaccount;
import com.google.gson.stream.MalformedJsonException;
import org.junit.Test;
import org.wikipedia.dataclient.Service;
import org.wikipedia.dataclient.mwapi.CreateAccountResponse;
import org.wikipedia.test.MockRetrofitTest;
import io.reactivex.Observable;
import io.reactivex.observers.TestObserver;
public class CreateAccountClientTest extends MockRetrofitTest {
private Observable<CreateAccountResponse> getObservable() {
return getApiService().postCreateAccount("user", "pass", "pass", "token", Service.WIKIPEDIA_URL, null, null, null);
}
@Test public void testRequestSuccess() throws Throwable {
enqueueFromFile("create_account_success.json");
TestObserver<CreateAccountResponse> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.status().equals("PASS")
&& result.user().equals("Farb0nucci"));
}
@Test public void testRequestFailure() throws Throwable {
enqueueFromFile("create_account_failure.json");
TestObserver<CreateAccountResponse> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.status().equals("FAIL"));
}
@Test public void testRequestResponse404() {
enqueue404();
TestObserver<CreateAccountResponse> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(Exception.class);
}
@Test public void testRequestResponseMalformed() {
enqueueMalformed();
TestObserver<CreateAccountResponse> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(MalformedJsonException.class);
}
}

View file

@ -0,0 +1,48 @@
package org.wikipedia.createaccount;
import com.google.gson.stream.MalformedJsonException;
import org.junit.Test;
import org.wikipedia.dataclient.mwapi.MwQueryResponse;
import org.wikipedia.test.MockRetrofitTest;
import io.reactivex.Observable;
import io.reactivex.observers.TestObserver;
public class CreateAccountInfoClientTest extends MockRetrofitTest {
@Test public void testRequestSuccess() throws Throwable {
enqueueFromFile("create_account_info.json");
TestObserver<MwQueryResponse> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(response -> {
String token = response.query().createAccountToken();
String captchaId = response.query().captchaId();
return token.equals("5d78e6a823be0901eeae9f6486f752da59123760+\\")
&& captchaId.equals("272460457");
});
}
@Test public void testRequestResponse404() {
enqueue404();
TestObserver<MwQueryResponse> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(Exception.class);
}
@Test public void testRequestResponseMalformed() {
enqueueMalformed();
TestObserver<MwQueryResponse> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(MalformedJsonException.class);
}
private Observable<MwQueryResponse> getObservable() {
return getApiService().getAuthManagerInfo();
}
}

View file

@ -0,0 +1,87 @@
package org.wikipedia.csrf;
import androidx.annotation.NonNull;
import com.google.gson.stream.MalformedJsonException;
import org.junit.Test;
import org.wikipedia.csrf.CsrfTokenClient.Callback;
import org.wikipedia.dataclient.Service;
import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.dataclient.mwapi.MwException;
import org.wikipedia.dataclient.mwapi.MwQueryResponse;
import org.wikipedia.dataclient.okhttp.HttpStatusException;
import org.wikipedia.test.MockWebServerTest;
import retrofit2.Call;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Matchers.isA;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
public class CsrfTokenClientTest extends MockWebServerTest {
private static final WikiSite TEST_WIKI = new WikiSite("test.wikipedia.org");
@NonNull private final CsrfTokenClient subject = new CsrfTokenClient(TEST_WIKI, TEST_WIKI);
@Test public void testRequestSuccess() throws Throwable {
String expected = "b6f7bd58c013ab30735cb19ecc0aa08258122cba+\\";
enqueueFromFile("csrf_token.json");
Callback cb = mock(Callback.class);
request(cb);
server().takeRequest();
assertCallbackSuccess(cb, expected);
}
@Test public void testRequestResponseApiError() throws Throwable {
enqueueFromFile("api_error.json");
Callback cb = mock(Callback.class);
request(cb);
server().takeRequest();
assertCallbackFailure(cb, MwException.class);
}
@Test public void testRequestResponseFailure() throws Throwable {
enqueue404();
Callback cb = mock(Callback.class);
request(cb);
server().takeRequest();
assertCallbackFailure(cb, HttpStatusException.class);
}
@Test public void testRequestResponseMalformed() throws Throwable {
enqueueMalformed();
Callback cb = mock(Callback.class);
request(cb);
server().takeRequest();
assertCallbackFailure(cb, MalformedJsonException.class);
}
private void assertCallbackSuccess(@NonNull Callback cb,
@NonNull String expected) {
verify(cb).success(eq(expected));
//noinspection unchecked
verify(cb, never()).failure(any(Throwable.class));
}
private void assertCallbackFailure(@NonNull Callback cb,
@NonNull Class<? extends Throwable> throwable) {
//noinspection unchecked
verify(cb, never()).success(any(String.class));
verify(cb).failure(isA(throwable));
}
private Call<MwQueryResponse> request(@NonNull Callback cb) {
return subject.request(service(Service.class), cb);
}
}

View file

@ -0,0 +1,228 @@
package org.wikipedia.dataclient;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.wikipedia.json.GsonMarshaller;
import org.wikipedia.json.GsonUnmarshaller;
import org.wikipedia.page.PageTitle;
import org.wikipedia.test.TestParcelUtil;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
@RunWith(RobolectricTestRunner.class) public class WikiSiteTest {
@Test public void testSupportedAuthority() {
assertThat(WikiSite.supportedAuthority("fr.wikipedia.org"), is(true));
assertThat(WikiSite.supportedAuthority("fr.m.wikipedia.org"), is(true));
assertThat(WikiSite.supportedAuthority("roa-rup.wikipedia.org"), is(true));
assertThat(WikiSite.supportedAuthority("google.com"), is(false));
}
@Test public void testForLanguageCodeScheme() {
WikiSite subject = WikiSite.forLanguageCode("test");
assertThat(subject.scheme(), is("https"));
}
@Test public void testForLanguageCodeAuthority() {
WikiSite subject = WikiSite.forLanguageCode("test");
assertThat(subject.authority(), is("test.wikipedia.org"));
}
@Test public void testForLanguageCodeLanguage() {
WikiSite subject = WikiSite.forLanguageCode("test");
assertThat(subject.languageCode(), is("test"));
}
@Test public void testForLanguageCodeNoLanguage() {
WikiSite subject = WikiSite.forLanguageCode("");
assertThat(subject.languageCode(), is(""));
}
@Test public void testForLanguageCodeNoLanguageAuthority() {
WikiSite subject = WikiSite.forLanguageCode("");
assertThat(subject.authority(), is("wikipedia.org"));
}
@Test public void testForLanguageCodeLanguageAuthority() {
WikiSite subject = WikiSite.forLanguageCode("zh-hans");
assertThat(subject.authority(), is("zh.wikipedia.org"));
assertThat(subject.languageCode(), is("zh-hans"));
}
@Test public void testCtorScheme() {
WikiSite subject = new WikiSite("http://wikipedia.org");
assertThat(subject.scheme(), is("http"));
}
@Test public void testCtorDefaultScheme() {
WikiSite subject = new WikiSite("wikipedia.org");
assertThat(subject.scheme(), is("https"));
}
@Test public void testCtorAuthority() {
WikiSite subject = new WikiSite("test.wikipedia.org");
assertThat(subject.authority(), is("test.wikipedia.org"));
}
@Test public void testCtorAuthorityLanguage() {
WikiSite subject = new WikiSite("test.wikipedia.org");
assertThat(subject.languageCode(), is("test"));
}
@Test public void testCtorAuthorityNoLanguage() {
WikiSite subject = new WikiSite("wikipedia.org");
assertThat(subject.languageCode(), is(""));
}
@Test public void testCtorMobileAuthorityLanguage() {
WikiSite subject = new WikiSite("test.m.wikipedia.org");
assertThat(subject.languageCode(), is("test"));
}
@Test public void testCtorMobileAuthorityNoLanguage() {
WikiSite subject = new WikiSite("m.wikipedia.org");
assertThat(subject.languageCode(), is(""));
}
@Test public void testCtorUriLangVariant() {
WikiSite subject = new WikiSite("zh.wikipedia.org/zh-hant/Foo");
assertThat(subject.authority(), is("zh.wikipedia.org"));
assertThat(subject.mobileAuthority(), is("zh.m.wikipedia.org"));
assertThat(subject.subdomain(), is("zh"));
assertThat(subject.languageCode(), is("zh-hant"));
assertThat(subject.scheme(), is("https"));
assertThat(subject.dbName(), is("zhwiki"));
assertThat(subject.url(), is("https://zh.wikipedia.org"));
}
@Test public void testCtorMobileUriLangVariant() {
WikiSite subject = new WikiSite("zh.m.wikipedia.org/zh-hant/Foo");
assertThat(subject.authority(), is("zh.m.wikipedia.org"));
assertThat(subject.mobileAuthority(), is("zh.m.wikipedia.org"));
assertThat(subject.subdomain(), is("zh"));
assertThat(subject.languageCode(), is("zh-hant"));
assertThat(subject.scheme(), is("https"));
assertThat(subject.url(), is("https://zh.m.wikipedia.org"));
}
@Test public void testCtorUriNoLangVariant() {
WikiSite subject = new WikiSite("http://zh.wikipedia.org/wiki/Foo");
assertThat(subject.authority(), is("zh.wikipedia.org"));
assertThat(subject.mobileAuthority(), is("zh.m.wikipedia.org"));
assertThat(subject.subdomain(), is("zh"));
assertThat(subject.languageCode(), is("zh"));
assertThat(subject.scheme(), is("http"));
assertThat(subject.url(), is("http://zh.wikipedia.org"));
}
@Test public void testCtorParcel() throws Throwable {
WikiSite subject = WikiSite.forLanguageCode("test");
TestParcelUtil.test(subject);
}
@Test public void testAuthority() {
WikiSite subject = new WikiSite("test.wikipedia.org", "test");
assertThat(subject.authority(), is("test.wikipedia.org"));
}
@Test public void testMobileAuthorityLanguage() {
WikiSite subject = WikiSite.forLanguageCode("fiu-vro");
assertThat(subject.mobileAuthority(), is("fiu-vro.m.wikipedia.org"));
}
@Test public void testMobileAuthorityNoLanguage() {
WikiSite subject = new WikiSite("wikipedia.org");
assertThat(subject.mobileAuthority(), is("m.wikipedia.org"));
}
@Test public void testMobileAuthorityLanguageAuthority() {
WikiSite subject = new WikiSite("no.wikipedia.org", "nb");
assertThat(subject.mobileAuthority(), is("no.m.wikipedia.org"));
}
@Test public void testMobileAuthorityMobileAuthority() {
WikiSite subject = new WikiSite("ru.m.wikipedia.org");
assertThat(subject.mobileAuthority(), is("ru.m.wikipedia.org"));
}
@Test public void testMobileAuthorityMobileAuthorityNoLanguage() {
WikiSite subject = new WikiSite("m.wikipedia.org");
assertThat(subject.mobileAuthority(), is("m.wikipedia.org"));
}
@Test public void testDbNameLanguage() {
WikiSite subject = new WikiSite("en.wikipedia.org", "en");
assertThat(subject.dbName(), is("enwiki"));
}
@Test public void testDbNameSpecialLanguage() {
WikiSite subject = new WikiSite("no.wikipedia.org", "nb");
assertThat(subject.dbName(), is("nowiki"));
}
@Test public void testDbNameWithOneUnderscore() {
WikiSite subject = new WikiSite("zh-yue.wikipedia.org");
assertThat(subject.dbName(), is("zh_yuewiki"));
}
@Test public void testDbNameWithTwoUnderscore() {
WikiSite subject = new WikiSite("zh-min-nan.wikipedia.org");
assertThat(subject.dbName(), is("zh_min_nanwiki"));
}
@Test public void testPath() {
WikiSite subject = WikiSite.forLanguageCode("test");
assertThat(subject.path("Segment"), is("/w/Segment"));
}
@Test public void testPathEmpty() {
WikiSite subject = WikiSite.forLanguageCode("test");
assertThat(subject.path(""), is("/w/"));
}
@Test public void testUrl() {
WikiSite subject = new WikiSite("test.192.168.1.11:8080", "test");
assertThat(subject.url(), is("https://test.192.168.1.11:8080"));
}
@Test public void testUrlPath() {
WikiSite subject = WikiSite.forLanguageCode("test");
assertThat(subject.url("Segment"), is("https://test.wikipedia.org/w/Segment"));
}
@Test public void testLanguageCode() {
WikiSite subject = WikiSite.forLanguageCode("lang");
assertThat(subject.languageCode(), is("lang"));
}
@Test public void testUnmarshal() {
WikiSite wiki = WikiSite.forLanguageCode("test");
assertThat(GsonUnmarshaller.unmarshal(WikiSite.class, GsonMarshaller.marshal(wiki)), is(wiki));
}
@Test public void testUnmarshalScheme() {
WikiSite wiki = new WikiSite("wikipedia.org", "");
assertThat(GsonUnmarshaller.unmarshal(WikiSite.class, GsonMarshaller.marshal(wiki)), is(wiki));
}
@Test public void testTitleForInternalLink() {
WikiSite wiki = WikiSite.forLanguageCode("en");
assertThat(new PageTitle("wiki", wiki), is(wiki.titleForInternalLink("wiki")));
assertThat(new PageTitle("wiki", wiki), is(wiki.titleForInternalLink("/wiki/wiki")));
assertThat(new PageTitle("wiki/wiki", wiki), is(wiki.titleForInternalLink("/wiki/wiki/wiki")));
}
@Test public void testEquals() {
assertThat(WikiSite.forLanguageCode("en"), is(WikiSite.forLanguageCode("en")));
assertThat(WikiSite.forLanguageCode("ta"), not(WikiSite.forLanguageCode("en")));
assertThat(WikiSite.forLanguageCode("ta").equals("ta.wikipedia.org"), is(false));
}
@Test public void testNormalization() {
assertThat("bm.wikipedia.org", is(WikiSite.forLanguageCode("bm").authority()));
}
}

View file

@ -0,0 +1,75 @@
package org.wikipedia.dataclient.mwapi.page;
import androidx.annotation.NonNull;
import org.junit.Before;
import org.junit.Test;
import org.wikipedia.dataclient.mwapi.MwException;
import org.wikipedia.dataclient.page.BasePageLeadTest;
import org.wikipedia.dataclient.page.PageClient;
import io.reactivex.observers.TestObserver;
import okhttp3.CacheControl;
import retrofit2.Response;
import static org.wikipedia.json.GsonUnmarshaller.unmarshal;
public class MwMobileViewPageLeadTest extends BasePageLeadTest {
private PageClient subject;
@Before public void setUp() throws Throwable {
super.setUp();
subject = new MwPageClient();
}
@Test public void testEnglishMainPage() {
MwMobileViewPageLead pageLead = unmarshal(MwMobileViewPageLead.class, wrapInMobileview(getEnglishMainPageJson()));
MwMobileViewPageLead.Mobileview props = pageLead.getMobileview();
verifyEnglishMainPage(props);
}
@Test public void testUnprotectedDisambiguationPage() {
MwMobileViewPageLead pageLead = unmarshal(MwMobileViewPageLead.class,
wrapInMobileview(getUnprotectedDisambiguationPageJson()));
MwMobileViewPageLead.Mobileview props = pageLead.getMobileview();
verifyUnprotectedDisambiguationPage(props);
}
/**
* Custom deserializer; um, yeah /o\.
* An earlier version had issues with protection settings that don't include "edit" protection.
*/
@Test public void testProtectedButNoEditProtectionPage() {
MwMobileViewPageLead pageLead = unmarshal(MwMobileViewPageLead.class,
wrapInMobileview(getProtectedButNoEditProtectionPageJson()));
MwMobileViewPageLead.Mobileview props = pageLead.getMobileview();
verifyProtectedNoEditProtectionPage(props);
}
@Test @SuppressWarnings("checkstyle:magicnumber") public void testThumbUrls() throws Throwable {
enqueueFromFile("page_lead_mw.json");
TestObserver<Response<MwMobileViewPageLead>> observer = new TestObserver<>();
getApiService().getLeadSection(CacheControl.FORCE_NETWORK.toString(), null, null, "foo", 640, "en").subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.body().getLeadImageUrl(640).contains("640px")
&& result.body().getThumbUrl().contains(preferredThumbSizeString())
&& result.body().getDescription().contains("Mexican boxer"));
}
@Test public void testError() {
try {
unmarshal(MwMobileViewPageLead.class, getErrorJson());
} catch (MwException e) {
verifyError(e);
}
}
@NonNull @Override protected PageClient subject() {
return subject;
}
private String wrapInMobileview(String json) {
return "{\"mobileview\":" + json + "}";
}
}

View file

@ -0,0 +1,34 @@
package org.wikipedia.dataclient.mwapi.page;
import androidx.annotation.NonNull;
import org.junit.Before;
import org.junit.Test;
import org.wikipedia.dataclient.page.BasePageClientTest;
import org.wikipedia.dataclient.page.PageClient;
import org.wikipedia.dataclient.page.PageLead;
import io.reactivex.observers.TestObserver;
import retrofit2.Response;
public class MwPageClientTest extends BasePageClientTest {
private PageClient subject;
@Before public void setUp() throws Throwable {
super.setUp();
subject = new MwPageClient();
}
@Test public void testLeadThumbnailWidth() {
TestObserver<Response<PageLead>> observer = new TestObserver<>();
subject.lead(wikiSite(), null, null, null, "test", 10).subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.raw().request().url().toString().contains("10"));
}
@NonNull @Override protected PageClient subject() {
return subject;
}
}

View file

@ -0,0 +1,56 @@
package org.wikipedia.dataclient.okhttp.util;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.wikipedia.dataclient.WikiSite;
import okhttp3.HttpUrl;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
@RunWith(RobolectricTestRunner.class) public class HttpUrlUtilTest {
@Test public void testIsRestBaseProd() {
HttpUrl url = HttpUrl.parse("https://test.wikipedia.org/api/rest_v1/");
assertThat(HttpUrlUtil.isRestBase(url), is(true));
}
@Test public void testIsRestBaseLabs() {
HttpUrl url = HttpUrl.parse("http://appservice.wmflabs.org/test.wikipedia.org/v1/");
assertThat(HttpUrlUtil.isRestBase(url), is(true));
}
@Test public void testIsRestBaseDev() {
HttpUrl url = HttpUrl.parse("http://host:6927/192.168.1.11:8080/v1/");
assertThat(HttpUrlUtil.isRestBase(url), is(true));
}
@Test public void testIsRestBaseMediaWikiTest() {
HttpUrl url = HttpUrl.parse(WikiSite.forLanguageCode("test").url());
assertThat(HttpUrlUtil.isRestBase(url), is(false));
}
@Test public void testIsRestBaseMediaWikiDev() {
HttpUrl url = HttpUrl.parse("http://192.168.1.11:8080/");
assertThat(HttpUrlUtil.isRestBase(url), is(false));
}
@Test public void testIsMobileViewTest() {
HttpUrl url = HttpUrl.parse(WikiSite.forLanguageCode("test").url())
.newBuilder()
.addQueryParameter("action", "mobileview")
.build();
assertThat(HttpUrlUtil.isMobileView(url), is(true));
}
@Test public void testIsMobileViewDev() {
HttpUrl url = HttpUrl.parse("http://localhost:8080/?action=mobileview");
assertThat(HttpUrlUtil.isMobileView(url), is(true));
}
@Test public void testIsMobileViewRestBase() {
HttpUrl url = HttpUrl.parse("https://en.wikipedia.org/api/rest_v1/");
assertThat(HttpUrlUtil.isMobileView(url), is(false));
}
}

View file

@ -0,0 +1,88 @@
package org.wikipedia.dataclient.page;
import androidx.annotation.NonNull;
import org.junit.Test;
import org.wikipedia.dataclient.Service;
import org.wikipedia.test.MockRetrofitTest;
import io.reactivex.observers.TestObserver;
import okhttp3.CacheControl;
import retrofit2.Response;
import static org.wikipedia.dataclient.Service.PREFERRED_THUMB_SIZE;
public abstract class BasePageClientTest extends MockRetrofitTest {
@Test public void testLeadCacheControl() {
TestObserver<Response<PageLead>> observer = new TestObserver<>();
subject().lead(wikiSite(), CacheControl.FORCE_NETWORK, null, null, "foo", 0).subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.raw().request().header("Cache-Control").contains("no-cache"));
}
@Test public void testLeadHttpRefererUrl() {
String refererUrl = "https://en.wikipedia.org/wiki/United_States";
TestObserver<Response<PageLead>> observer = new TestObserver<>();
subject().lead(wikiSite(), null, null, refererUrl, "foo", 0).subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.raw().request().header("Referer").contains(refererUrl));
}
@Test public void testLeadCacheOptionCache() {
TestObserver<Response<PageLead>> observer = new TestObserver<>();
subject().lead(wikiSite(), null, null, null, "foo", 0).subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.raw().request().header(Service.OFFLINE_SAVE_HEADER) == null);
}
@Test public void testLeadCacheOptionSave() {
TestObserver<Response<PageLead>> observer = new TestObserver<>();
subject().lead(wikiSite(), null, Service.OFFLINE_SAVE_HEADER_SAVE, null, "foo", 0).subscribe(observer);
observer.assertComplete().assertValue(result -> result.raw().request().header(Service.OFFLINE_SAVE_HEADER).contains(Service.OFFLINE_SAVE_HEADER_SAVE));
}
@Test public void testLeadTitle() {
TestObserver<Response<PageLead>> observer = new TestObserver<>();
subject().lead(wikiSite(), null, null, null, "Title", 0).subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> {
System.out.println(result.raw().request().url());
System.out.println(result.raw().request().url().toString());
return result.raw().request().url().toString().contains("Title");
});
}
@Test public void testSectionsCacheControl() {
TestObserver<Response<PageRemaining>> observer = new TestObserver<>();
subject().sections(wikiSite(), CacheControl.FORCE_NETWORK, null, "foo").subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.raw().request().header("Cache-Control").contains("no-cache"));
}
@Test public void testSectionsCacheOptionCache() {
TestObserver<Response<PageRemaining>> observer = new TestObserver<>();
subject().sections(wikiSite(), null, null, "foo").subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.raw().request().header(Service.OFFLINE_SAVE_HEADER) == null);
}
@Test public void testSectionsCacheOptionSave() {
TestObserver<Response<PageRemaining>> observer = new TestObserver<>();
subject().sections(wikiSite(), null, Service.OFFLINE_SAVE_HEADER_SAVE, "foo").subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.raw().request().header(Service.OFFLINE_SAVE_HEADER).contains(Service.OFFLINE_SAVE_HEADER_SAVE));
}
@Test public void testSectionsTitle() {
TestObserver<Response<PageRemaining>> observer = new TestObserver<>();
subject().sections(wikiSite(), null, null, "Title").subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.raw().request().url().toString().contains("Title"));
}
@NonNull protected abstract PageClient subject();
protected String preferredThumbSizeString() {
return Integer.toString(PREFERRED_THUMB_SIZE) + "px";
}
}

View file

@ -0,0 +1,101 @@
package org.wikipedia.dataclient.page;
import androidx.annotation.NonNull;
import org.wikipedia.dataclient.mwapi.MwException;
import org.wikipedia.dataclient.mwapi.MwServiceError;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Common test code for the two PageLead variants.
*/
public abstract class BasePageLeadTest extends BasePageClientTest {
protected static final int ID = 15580374;
protected static final long REVISION = 664887982L;
protected static final int LANGUAGE_COUNT = 45;
protected static final String LAST_MODIFIED_DATE = "2015-05-31T17:32:11Z";
protected static final String MAIN_PAGE = "Main Page";
@NonNull
public static String getEnglishMainPageJson() {
return "{"
+ "\"lastmodified\":\"" + LAST_MODIFIED_DATE + "\","
+ "\"revision\":" + REVISION + ","
+ "\"languagecount\":" + LANGUAGE_COUNT + ","
+ "\"displaytitle\":\"" + MAIN_PAGE + "\","
+ "\"id\":" + ID + ","
+ "\"description\":\"main page of a Wikimedia project\","
+ "\"mainpage\":true,"
+ "\"sections\":["
+ "{\"id\":0,\"text\":\"My lead section text\"}"
+ "],"
+ "\"protection\":{\"edit\":[\"made_up_role1\"],\"move\":[\"made_up_role2\"]},"
+ "\"editable\":false"
+ "}";
}
protected void verifyEnglishMainPage(PageLeadProperties props) {
assertThat(props.getId(), is(ID));
assertThat(props.getRevision(), is(REVISION));
assertThat(props.getLastModified(), is(LAST_MODIFIED_DATE));
assertThat(props.getDisplayTitle(), is(MAIN_PAGE));
assertThat(props.getLanguageCount(), is(LANGUAGE_COUNT));
assertThat(props.getLeadImageUrl(0), equalTo(null));
assertThat(props.getLeadImageFileName(), equalTo(null));
assertThat(props.getSections().size(), is(1));
assertThat(props.getSections().get(0).getId(), is(0));
assertThat(props.getSections().get(0).getContent(), is("My lead section text"));
assertThat(props.getSections().get(0).getLevel(), is(1));
assertThat(props.getSections().get(0).getAnchor(), equalTo(""));
assertThat(props.getSections().get(0).getHeading(), equalTo(""));
assertThat(props.getFirstAllowedEditorRole(), is("made_up_role1"));
assertThat(props.isEditable(), is(false));
assertThat(props.isMainPage(), is(true));
assertThat(props.isDisambiguation(), is(false));
}
@NonNull
protected String getUnprotectedDisambiguationPageJson() {
return "{"
+ "\"disambiguation\":true,"
+ "\"protection\":{},"
+ "\"editable\":true"
+ "}";
}
protected void verifyUnprotectedDisambiguationPage(PageLeadProperties core) {
assertThat(core.getFirstAllowedEditorRole(), equalTo(null));
assertThat(core.isEditable(), is(true));
assertThat(core.isMainPage(), is(false));
assertThat(core.isDisambiguation(), is(true));
}
@NonNull
protected String getProtectedButNoEditProtectionPageJson() {
return "{"
+ "\"protection\":{\"move\":[\"sysop\"]}"
+ "}";
}
protected void verifyProtectedNoEditProtectionPage(PageLeadProperties core) {
assertThat(core.getFirstAllowedEditorRole(), equalTo(null));
}
@NonNull
protected String getErrorJson() {
return "{\"error\":{"
+ "\"code\":\"nopage\","
+ "\"info\":\"The page parameter must be set\","
+ "\"docref\":\"See https://en.wikipedia.org/w/api.php for API usage\""
+ "}}";
}
protected void verifyError(MwException e) {
MwServiceError error = e.getError();
assertThat(error.getTitle(), is("nopage"));
assertThat(error.getDetails(), is("The page parameter must be set"));
}
}

View file

@ -0,0 +1,57 @@
package org.wikipedia.dataclient.restbase.page;
import androidx.annotation.NonNull;
import org.junit.Before;
import org.junit.Test;
import org.wikipedia.dataclient.page.BasePageLeadTest;
import org.wikipedia.dataclient.page.PageClient;
import io.reactivex.observers.TestObserver;
import okhttp3.CacheControl;
import retrofit2.Response;
import static org.wikipedia.json.GsonUnmarshaller.unmarshal;
public class RbPageLeadTest extends BasePageLeadTest {
private PageClient subject;
@Before @Override public void setUp() throws Throwable {
super.setUp();
subject = new RbPageClient();
}
@Test public void testEnglishMainPage() {
RbPageLead props = unmarshal(RbPageLead.class, getEnglishMainPageJson());
verifyEnglishMainPage(props);
}
@Test public void testUnprotectedDisambiguationPage() {
RbPageLead props = unmarshal(RbPageLead.class, getUnprotectedDisambiguationPageJson());
verifyUnprotectedDisambiguationPage(props);
}
/**
* Custom deserializer; um, yeah /o\.
* An earlier version had issues with protection settings that don't include "edit" protection.
*/
@Test public void testProtectedButNoEditProtectionPage() {
RbPageLead props = unmarshal(RbPageLead.class, getProtectedButNoEditProtectionPageJson());
verifyProtectedNoEditProtectionPage(props);
}
@Test @SuppressWarnings("checkstyle:magicnumber") public void testThumbUrls() throws Throwable {
enqueueFromFile("page_lead_rb.json");
TestObserver<Response<RbPageLead>> observer = new TestObserver<>();
getRestService().getLeadSection(CacheControl.FORCE_NETWORK.toString(), null, null, "foo").subscribe(observer);
observer.assertComplete()
.assertValue(result -> result.body().getLeadImageUrl(640).contains("640px")
&& result.body().getThumbUrl().contains(preferredThumbSizeString())
&& result.body().getDescription().contains("Mexican boxer")
&& result.body().getDescriptionSource().contains("central"));
}
@NonNull @Override protected PageClient subject() {
return subject;
}
}

View file

@ -0,0 +1,40 @@
package org.wikipedia.dataclient.restbase.page;
import org.junit.Before;
import org.junit.Test;
import org.wikipedia.feed.mostread.MostReadArticlesTest;
import java.util.List;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
@SuppressWarnings("checkstyle:magicnumber")
public class RbPageSummaryTest {
private List<RbPageSummary> subjects;
@Before public void setUp() throws Throwable {
subjects = MostReadArticlesTest.unmarshal("most_read.json").articles();
}
@Test public void testUnmarshalThumbnails() {
RbPageSummary subject = subjects.get(3);
assertThat(subject.getNormalizedTitle(), is("Marilyn Monroe"));
assertThat(subject.getTitle(), is("Marilyn_Monroe"));
assertThat(subject.getDescription(), is("American actress, model, and singer"));
String thumbnail = "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0a/Marilyn_Monroe_in_1952.jpg/229px-Marilyn_Monroe_in_1952.jpg";
assertThat(subject.getThumbnailUrl(), is(thumbnail));
}
@Test public void testUnmarshalNoThumbnails() {
RbPageSummary subject = subjects.get(0);
assertThat(subject.getNormalizedTitle(), is("Bicycle Race"));
assertThat(subject.getTitle(), is("Bicycle_Race"));
assertThat(subject.getDescription(), is("rock song by Queen"));
assertThat(subject.getThumbnailUrl(), nullValue());
}
}

View file

@ -0,0 +1,147 @@
package org.wikipedia.edit;
import androidx.annotation.NonNull;
import com.google.gson.stream.MalformedJsonException;
import org.junit.Test;
import org.wikipedia.captcha.CaptchaResult;
import org.wikipedia.dataclient.Service;
import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.dataclient.mwapi.MwException;
import org.wikipedia.dataclient.okhttp.HttpStatusException;
import org.wikipedia.page.PageTitle;
import org.wikipedia.test.MockWebServerTest;
import retrofit2.Call;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Matchers.isA;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
public class EditClientTest extends MockWebServerTest {
private EditClient subject = new EditClient();
@Test @SuppressWarnings("checkstyle:magicnumber")
public void testRequestSuccessHasResults() throws Throwable {
EditSuccessResult expected = new EditSuccessResult(761350490);
enqueueFromFile("edit_result_success.json");
EditClient.Callback cb = mock(EditClient.Callback.class);
Call<Edit> call = request(cb, false);
server().takeRequest();
assertCallbackSuccess(call, cb, expected);
}
@Test public void testRequestResponseAbuseFilter() throws Throwable {
EditAbuseFilterResult expected = new EditAbuseFilterResult("abusefilter-disallowed",
"Hit AbuseFilter: Editing user page by anonymous user",
"<b>Warning:</b> This action has been automatically identified as harmful.\nUnconstructive edits will be quickly reverted,\nand egregious or repeated unconstructive editing will result in your account or IP address being blocked.\nIf you believe this action to be constructive, you may submit it again to confirm it.\nA brief description of the abuse rule which your action matched is: Editing user page by anonymous user");
enqueueFromFile("edit_abuse_filter_result.json");
EditClient.Callback cb = mock(EditClient.Callback.class);
Call<Edit> call = request(cb, false);
server().takeRequest();
assertCallbackSuccess(call, cb, expected);
}
@Test public void testRequestResponseSpamBlacklist() throws Throwable {
EditSpamBlacklistResult expected = new EditSpamBlacklistResult("s-e-x");
enqueueFromFile("edit_result_spam_blacklist.json");
EditClient.Callback cb = mock(EditClient.Callback.class);
Call<Edit> call = request(cb, false);
server().takeRequest();
assertCallbackSuccess(call, cb, expected);
}
@Test @SuppressWarnings("checkstyle:magicnumber")
public void testRequestResponseCaptcha() throws Throwable {
CaptchaResult expected = new CaptchaResult("547159230");
enqueueFromFile("edit_result_captcha.json");
EditClient.Callback cb = mock(EditClient.Callback.class);
Call<Edit> call = request(cb, false);
server().takeRequest();
assertCallbackSuccess(call, cb, expected);
}
@Test public void testRequestResponseAssertUserFailed() throws Throwable {
enqueueFromFile("api_error_assert_user_failed.json");
EditClient.Callback cb = mock(EditClient.Callback.class);
Call<Edit> call = request(cb, true);
server().takeRequest();
assertCallbackFailure(call, cb, MwException.class);
}
@Test public void testRequestResponseGenericApiError() throws Throwable {
enqueueFromFile("api_error.json");
EditClient.Callback cb = mock(EditClient.Callback.class);
Call<Edit> call = request(cb, false);
server().takeRequest();
assertCallbackFailure(call, cb, MwException.class);
}
@Test public void testRequestResponseApiError() throws Throwable {
enqueueFromFile("api_error.json");
EditClient.Callback cb = mock(EditClient.Callback.class);
Call<Edit> call = request(cb, false);
server().takeRequest();
assertCallbackFailure(call, cb, MwException.class);
}
@Test public void testRequestResponse404() throws Throwable {
enqueue404();
EditClient.Callback cb = mock(EditClient.Callback.class);
Call<Edit> call = request(cb, false);
server().takeRequest();
assertCallbackFailure(call, cb, HttpStatusException.class);
}
@Test public void testRequestResponseMalformed() throws Throwable {
enqueueMalformed();
EditClient.Callback cb = mock(EditClient.Callback.class);
Call<Edit> call = request(cb, false);
server().takeRequest();
assertCallbackFailure(call, cb, MalformedJsonException.class);
}
private void assertCallbackSuccess(@NonNull Call<Edit> call,
@NonNull EditClient.Callback cb,
@NonNull EditResult expected) {
verify(cb).success(eq(call), eq(expected));
//noinspection unchecked
verify(cb, never()).failure(any(Call.class), any(Throwable.class));
}
private void assertCallbackFailure(@NonNull Call<Edit> call,
@NonNull EditClient.Callback cb,
@NonNull Class<? extends Throwable> throwable) {
//noinspection unchecked
verify(cb, never()).success(any(Call.class), any(EditResult.class));
verify(cb).failure(eq(call), isA(throwable));
}
private Call<Edit> request(@NonNull EditClient.Callback cb, boolean loggedIn) {
PageTitle title = new PageTitle(null, "TEST", WikiSite.forLanguageCode("test"));
return subject.request(service(Service.class), title, 0, "new text", "token",
"summary", null, loggedIn, "captchaId", "captchaSubmission", cb);
}
}

View file

@ -0,0 +1,81 @@
package org.wikipedia.edit;
import androidx.annotation.NonNull;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.wikipedia.dataclient.Service;
import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.edit.EditClient.Callback;
import org.wikipedia.page.PageTitle;
import org.wikipedia.test.MockWebServerTest;
import retrofit2.Call;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Matchers.isA;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
public class EditUnitTest extends MockWebServerTest {
@NonNull private EditClient client = new EditClient();
@Test public void testAbuseFilterResult() throws Throwable {
enqueueFromFile("edit_abuse_filter_result.json");
Callback cb = mock(Callback.class);
Call<Edit> call = request(cb);
server().takeRequest();
assertAbuseFilterEditResult(call, cb);
}
@Test public void testBadToken() throws Throwable {
enqueueFromFile("edit_error_bad_token.json");
Callback cb = mock(Callback.class);
Call<Edit> call = request(cb);
server().takeRequest();
assertExpectedEditError(call, cb, "Invalid token");
}
@Test public void testRequestUserNotLoggedIn() throws Throwable {
enqueueFromFile("edit_user_not_logged_in.json");
Callback cb = mock(Callback.class);
Call<Edit> call = request(cb);
server().takeRequest();
assertExpectedEditError(call, cb, "Assertion that the user is logged in failed");
}
@NonNull private Call<Edit> request(@NonNull Callback cb) {
return client.request(service(Service.class), new PageTitle("FAKE TITLE",
WikiSite.forLanguageCode("test")), 0, "FAKE EDIT TEXT", "+/", "FAKE SUMMARY", null, false,
null, null, cb);
}
private void assertAbuseFilterEditResult(@NonNull Call<Edit> call,
@NonNull Callback cb) {
verify(cb).success(eq(call), isA(EditAbuseFilterResult.class));
//noinspection unchecked
verify(cb, never()).failure(any(Call.class), any(Throwable.class));
}
private void assertExpectedEditError(@NonNull Call<Edit> call,
@NonNull Callback cb,
@NonNull String expectedCode) {
ArgumentCaptor<Throwable> captor = ArgumentCaptor.forClass(Throwable.class);
//noinspection unchecked
verify(cb, never()).success(any(Call.class), any(EditSuccessResult.class));
verify(cb).failure(eq(call), captor.capture());
Throwable t = captor.getValue();
assertThat(t.getMessage(), is(expectedCode));
}
}

View file

@ -0,0 +1,47 @@
package org.wikipedia.edit.preview;
import com.google.gson.stream.MalformedJsonException;
import org.junit.Test;
import org.wikipedia.dataclient.mwapi.MwException;
import org.wikipedia.test.MockRetrofitTest;
import io.reactivex.Observable;
import io.reactivex.observers.TestObserver;
public class EditPreviewClientTest extends MockRetrofitTest {
@Test public void testRequestSuccessHasResults() throws Throwable {
String expected = "<div class=\"mf-section-0\" id=\"mf-section-0\"><p>\\o/\\n\\ntest12\\n\\n3</p>\n\n\n\n\n</div>";
enqueueFromFile("edit_preview.json");
TestObserver<EditPreview> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(response -> response.result().equals(expected));
}
@Test public void testRequestResponseApiError() throws Throwable {
enqueueFromFile("api_error.json");
TestObserver<EditPreview> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(MwException.class);
}
@Test public void testRequestResponseMalformed() {
enqueueMalformed();
TestObserver<EditPreview> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(MalformedJsonException.class);
}
private Observable<EditPreview> getObservable() {
return getApiService().postEditPreview("User:Mhollo/sandbox", "wikitext of change");
}
}

View file

@ -0,0 +1,47 @@
package org.wikipedia.edit.wikitext;
import com.google.gson.stream.MalformedJsonException;
import org.junit.Test;
import org.wikipedia.dataclient.mwapi.MwException;
import org.wikipedia.dataclient.mwapi.MwQueryResponse;
import org.wikipedia.test.MockRetrofitTest;
import io.reactivex.Observable;
import io.reactivex.observers.TestObserver;
public class WikitextClientTest extends MockRetrofitTest {
@Test public void testRequestSuccessHasResults() throws Throwable {
enqueueFromFile("wikitext.json");
TestObserver<MwQueryResponse> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(response -> response.query().firstPage().revisions().get(0).content().equals("\\o/\n\ntest12\n\n3")
&& response.query().firstPage().revisions().get(0).timeStamp().equals("2018-03-18T18:10:54Z"));
}
@Test public void testRequestResponseApiError() throws Throwable {
enqueueFromFile("api_error.json");
TestObserver<MwQueryResponse> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(MwException.class);
}
@Test public void testRequestResponseMalformed() {
enqueueMalformed();
TestObserver<MwQueryResponse> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(MalformedJsonException.class);
}
private Observable<MwQueryResponse> getObservable() {
return getApiService().getWikiTextForSection("User:Mhollo/sandbox", 0);
}
}

View file

@ -0,0 +1,63 @@
package org.wikipedia.feed.announcement;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
@RunWith(RobolectricTestRunner.class)
public class GeoIPCookieUnmarshallerTest {
private static final double LATITUDE = 37.33;
private static final double LONGITUDE = -121.89;
@Test public void testGeoIPWithLocation() {
GeoIPCookie cookie = GeoIPCookieUnmarshaller.unmarshal("US:California:San Francisco:" + LATITUDE + ":" + LONGITUDE + ":v4");
assertThat(cookie.country(), is("US"));
assertThat(cookie.region(), is("California"));
assertThat(cookie.city(), is("San Francisco"));
assertThat(cookie.location(), is(notNullValue()));
assertThat(cookie.location().getLatitude(), is(LATITUDE));
assertThat(cookie.location().getLongitude(), is(LONGITUDE));
}
@Test public void testGeoIPWithoutLocation() {
GeoIPCookie cookie = GeoIPCookieUnmarshaller.unmarshal("FR::Paris:::v4");
assertThat(cookie.country(), is("FR"));
assertThat(cookie.region(), is(""));
assertThat(cookie.city(), is("Paris"));
assertThat(cookie.location(), is(nullValue()));
}
@Test public void testGeoIPEmpty() {
GeoIPCookie cookie = GeoIPCookieUnmarshaller.unmarshal(":::::v4");
assertThat(cookie.country(), is(""));
assertThat(cookie.region(), is(""));
assertThat(cookie.city(), is(""));
assertThat(cookie.location(), is(nullValue()));
}
@Test(expected = IllegalArgumentException.class)
public void testGeoIPWrongVersion() {
GeoIPCookieUnmarshaller.unmarshal("RU::Moscow:1:2:v5");
}
@Test(expected = IllegalArgumentException.class)
public void testGeoIPWrongParamCount() {
GeoIPCookieUnmarshaller.unmarshal("CA:Toronto:v4");
}
@Test(expected = IllegalArgumentException.class)
public void testGeoIPMalformed() {
GeoIPCookieUnmarshaller.unmarshal("foo");
}
@Test(expected = IllegalArgumentException.class)
public void testGeoIPWithBadLocation() {
GeoIPCookieUnmarshaller.unmarshal("US:California:San Francisco:foo:bar:v4");
}
}

View file

@ -0,0 +1,42 @@
package org.wikipedia.feed.mostread;
import androidx.annotation.NonNull;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.wikipedia.json.GsonUnmarshaller;
import org.wikipedia.test.TestFileUtil;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
@RunWith(RobolectricTestRunner.class)
@SuppressWarnings("checkstyle:magicnumber")
public class MostReadArticlesTest {
@NonNull public static MostReadArticles unmarshal(@NonNull String filename) throws Throwable {
String json = TestFileUtil.readRawFile(filename);
return GsonUnmarshaller.unmarshal(MostReadArticles.class, json);
}
@Test public void testUnmarshalManyArticles() throws Throwable {
MostReadArticles subject = unmarshal("most_read.json");
assertThat(subject.date(), is(date("2016-06-01Z")));
assertThat(subject.articles(), notNullValue());
assertThat(subject.articles().size(), is(40));
}
@NonNull private Date date(@NonNull String str) throws Throwable {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'Z'", Locale.ROOT);
format.setTimeZone(TimeZone.getTimeZone("UTC"));
return format.parse(str);
}
}

View file

@ -0,0 +1,108 @@
package org.wikipedia.gallery;
import com.google.gson.stream.MalformedJsonException;
import org.junit.Test;
import org.wikipedia.test.MockRetrofitTest;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.observers.TestObserver;
public class GalleryClientTest extends MockRetrofitTest {
private static final String RAW_JSON_FILE = "gallery.json";
@Test
@SuppressWarnings("checkstyle:magicnumber")
public void testRequestAllSuccess() throws Throwable {
enqueueFromFile(RAW_JSON_FILE);
TestObserver<Gallery> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(gallery -> {
List<GalleryItem> result = gallery.getAllItems();
return result != null
&& result.get(0).getType().equals("image")
&& result.get(2).getType().equals("audio")
&& result.get(4).getType().equals("video");
});
}
@Test
public void testRequestImageSuccess() throws Throwable {
enqueueFromFile(RAW_JSON_FILE);
TestObserver<Gallery> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(gallery -> {
List<GalleryItem> result = gallery.getItems("image");
return result.size() == 2
&& result.get(0).getType().equals("image")
&& result.get(0).getTitles().getCanonical().equals("File:Flag_of_the_United_States.svg")
&& result.get(0).getThumbnail().getSource().equals("http://upload.wikimedia.org/wikipedia/en/thumb/a/a4/Flag_of_the_United_States.svg/320px-Flag_of_the_United_States.svg.png")
&& result.get(0).getThumbnailUrl().equals("http://upload.wikimedia.org/wikipedia/en/thumb/a/a4/Flag_of_the_United_States.svg/320px-Flag_of_the_United_States.svg.png")
&& result.get(0).getPreferredSizedImageUrl().equals("http://upload.wikimedia.org/wikipedia/en/thumb/a/a4/Flag_of_the_United_States.svg/1280px-Flag_of_the_United_States.svg.png");
});
}
@Test
@SuppressWarnings("checkstyle:magicnumber")
public void testRequestVideoSuccess() throws Throwable {
enqueueFromFile(RAW_JSON_FILE);
TestObserver<Gallery> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(gallery -> {
List<GalleryItem> result = gallery.getItems("video");
return result.get(0).getSources().size() == 6
&& result.get(0).getType().equals("video")
&& result.get(0).getTitles().getCanonical().equals("File:Curiosity's_Seven_Minutes_of_Terror.ogv")
&& result.get(0).getFilePage().equals("https://commons.wikimedia.org/wiki/File:Curiosity%27s_Seven_Minutes_of_Terror.ogv")
&& result.get(0).getOriginalVideoSource().getOriginalUrl().equals("https://upload.wikimedia.org/wikipedia/commons/transcoded/9/96/Curiosity%27s_Seven_Minutes_of_Terror.ogv/Curiosity%27s_Seven_Minutes_of_Terror.ogv.720p.webm");
});
}
@Test
@SuppressWarnings("checkstyle:magicnumber")
public void testRequestAudioSuccess() throws Throwable {
enqueueFromFile(RAW_JSON_FILE);
TestObserver<Gallery> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(gallery -> {
List<GalleryItem> result = gallery.getItems("audio");
return result.size() == 2
&& result.get(0).getType().equals("audio")
&& result.get(1).getTitles().getCanonical().equals("File:March,_Colonel_John_R._Bourgeois,_Director_·_John_Philip_Sousa_·_United_States_Marine_Band.ogg")
&& result.get(1).getDuration() == 226.51766666667
&& result.get(0).getAudioType().equals("generic");
});
}
@Test public void testRequestResponseFailure() {
enqueue404();
TestObserver<Gallery> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(Exception.class);
}
@Test public void testRequestResponseMalformed() {
enqueueMalformed();
TestObserver<Gallery> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(MalformedJsonException.class);
}
private Observable<Gallery> getObservable() {
return getRestService().getMedia("foo");
}
}

View file

@ -0,0 +1,71 @@
package org.wikipedia.gallery;
import com.google.gson.stream.MalformedJsonException;
import org.junit.Test;
import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.dataclient.mwapi.MwQueryPage;
import org.wikipedia.page.PageTitle;
import org.wikipedia.test.MockRetrofitTest;
import io.reactivex.observers.TestObserver;
public class ImageLicenseFetchClientTest extends MockRetrofitTest {
private static final WikiSite WIKISITE_TEST = WikiSite.forLanguageCode("test");
private static final PageTitle PAGE_TITLE_MARK_SELBY =
new PageTitle("File:Mark_Selby_at_Snooker_German_Masters_(DerHexer)_2015-02-04_02.jpg",
WIKISITE_TEST);
@Test public void testRequestSuccess() throws Throwable {
enqueueFromFile("image_license.json");
TestObserver<ImageLicense> observer = new TestObserver<>();
getApiService().getImageExtMetadata(PAGE_TITLE_MARK_SELBY.getPrefixedText())
.map(response -> {
// noinspection ConstantConditions
MwQueryPage page = response.query().pages().get(0);
return page.imageInfo() != null && page.imageInfo().getMetadata() != null
? new ImageLicense(page.imageInfo().getMetadata())
: new ImageLicense();
})
.subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.getLicenseName().equals("cc-by-sa-4.0")
&& result.getLicenseShortName().equals("CC BY-SA 4.0")
&& result.getLicenseUrl().equals("http://creativecommons.org/licenses/by-sa/4.0"));
}
@Test public void testRequestResponseApiError() throws Throwable {
enqueueFromFile("api_error.json");
TestObserver<ImageLicense> observer = new TestObserver<>();
getApiService().getImageExtMetadata(PAGE_TITLE_MARK_SELBY.getPrefixedText())
.map(response -> new ImageLicense())
.subscribe(observer);
observer.assertError(Exception.class);
}
@Test public void testRequestResponseFailure() {
enqueue404();
TestObserver<ImageLicense> observer = new TestObserver<>();
getApiService().getImageExtMetadata(PAGE_TITLE_MARK_SELBY.getPrefixedText())
.map(response -> new ImageLicense())
.subscribe(observer);
observer.assertError(Exception.class);
}
@Test public void testRequestResponseMalformed() {
enqueueMalformed();
TestObserver<ImageLicense> observer = new TestObserver<>();
getApiService().getImageExtMetadata(PAGE_TITLE_MARK_SELBY.getPrefixedText())
.map(response -> new ImageLicense())
.subscribe(observer);
observer.assertError(MalformedJsonException.class);
}
}

View file

@ -0,0 +1,74 @@
package org.wikipedia.json;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.ParameterizedRobolectricTestRunner;
import org.robolectric.ParameterizedRobolectricTestRunner.Parameters;
import org.wikipedia.page.Namespace;
import java.util.Arrays;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.wikipedia.json.GsonMarshaller.marshal;
import static org.wikipedia.json.GsonUnmarshaller.unmarshal;
@RunWith(ParameterizedRobolectricTestRunner.class) public class NamespaceTypeAdapterTest {
@Parameters(name = "{0}") public static Iterable<Object[]> data() {
return Arrays.asList(new Object[][] {{DeferredParam.NULL}, {DeferredParam.SPECIAL},
{DeferredParam.MAIN}, {DeferredParam.TALK}});
}
@Nullable private final Namespace namespace;
public NamespaceTypeAdapterTest(@NonNull DeferredParam param) {
this.namespace = param.val();
}
@Test public void testWriteRead() {
Namespace result = unmarshal(Namespace.class, marshal(namespace));
assertThat(result, is(namespace));
}
@Test public void testReadOldData() {
// Prior to 3210ce44, we marshaled Namespace as the name string of the enum, instead of
// the code number, and when we switched to using the code number, we didn't introduce
// backwards-compatible checks for the old-style strings that may still be present in
// some local serialized data.
// TODO: remove after April 2017?
String marshaledStr = namespace == null ? "null" : "\"" + namespace.name() + "\"";
Namespace ns = unmarshal(Namespace.class, marshaledStr);
assertThat(ns, is(namespace));
}
// SparseArray is a Roboelectric mocked class which is unavailable at static time; defer
// evaluation until TestRunner is executed
private enum DeferredParam {
NULL() {
@Nullable @Override
Namespace val() {
return null;
}
},
SPECIAL() {
@NonNull @Override Namespace val() {
return Namespace.SPECIAL;
}
},
MAIN() {
@NonNull @Override Namespace val() {
return Namespace.MAIN;
}
},
TALK() {
@NonNull @Override Namespace val() {
return Namespace.TALK;
}
};
@Nullable abstract Namespace val();
}
}

View file

@ -0,0 +1,184 @@
package org.wikipedia.json;
import android.net.Uri;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.wikipedia.dataclient.Service;
import org.wikipedia.json.annotations.Required;
import org.wikipedia.model.BaseModel;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;
import static org.wikipedia.json.GsonMarshaller.marshal;
import static org.wikipedia.json.GsonUnmarshaller.unmarshal;
@RunWith(RobolectricTestRunner.class)
public class RequiredFieldsCheckOnReadTypeAdapterFactoryTest {
private final Gson gson = GsonUtil.getDefaultGsonBuilder().serializeNulls().create();
@Test
public void testRequireNonNull() {
RequiredModel expected = new RequiredModel();
expected.field = 1;
RequiredModel result = unmarshal(gson, RequiredModel.class, marshal(gson, expected));
assertThat(result, is(expected));
}
@Test
public void testRequireNull() {
RequiredModel model = new RequiredModel();
RequiredModel result = unmarshal(gson, RequiredModel.class, marshal(gson, model));
assertThat(result, nullValue());
}
@Test
public void testRequireMissing() {
RequiredModel result = unmarshal(gson, RequiredModel.class, "{}");
assertThat(result, nullValue());
}
@Test
public void testOptionalNonNull() {
OptionalModel expected = new OptionalModel();
expected.field = 1;
OptionalModel result = unmarshal(gson, OptionalModel.class, marshal(gson, expected));
assertThat(result, is(expected));
}
@Test
public void testOptionalNull() {
OptionalModel expected = new OptionalModel();
OptionalModel result = unmarshal(gson, OptionalModel.class, marshal(gson, expected));
assertThat(result, is(expected));
}
@Test
public void testOptionalMissing() {
OptionalModel expected = new OptionalModel();
OptionalModel result = unmarshal(gson, OptionalModel.class, "{}");
assertThat(result, is(expected));
}
@Test
public void testRequiredTypeAdapterNonNull() {
RequiredTypeAdapterModel expected = new RequiredTypeAdapterModel();
expected.uri = Uri.parse(Service.WIKIPEDIA_URL);
RequiredTypeAdapterModel result = unmarshal(gson, RequiredTypeAdapterModel.class, marshal(gson, expected));
assertThat(result, is(expected));
}
@Test
public void testRequiredTypeAdapterNull() {
RequiredTypeAdapterModel expected = new RequiredTypeAdapterModel();
RequiredTypeAdapterModel result = unmarshal(gson, RequiredTypeAdapterModel.class, marshal(gson, expected));
assertThat(result, nullValue());
}
@Test
public void testRequiredTypeAdapterMissing() {
RequiredTypeAdapterModel result = unmarshal(gson, RequiredTypeAdapterModel.class, "{}");
assertThat(result, nullValue());
}
@Test
public void testOptionalTypeAdapterNonNull() {
OptionalTypeAdapterModel expected = new OptionalTypeAdapterModel();
expected.uri = Uri.parse(Service.WIKIPEDIA_URL);
OptionalTypeAdapterModel result = unmarshal(gson, OptionalTypeAdapterModel.class, marshal(gson, expected));
assertThat(result, is(expected));
}
@Test
public void testOptionalTypeAdapterNull() {
OptionalTypeAdapterModel expected = new OptionalTypeAdapterModel();
OptionalTypeAdapterModel result = unmarshal(gson, OptionalTypeAdapterModel.class, marshal(gson, expected));
assertThat(result, is(expected));
}
@Test
public void testOptionalTypeAdapterMissing() {
OptionalTypeAdapterModel expected = new OptionalTypeAdapterModel();
OptionalTypeAdapterModel result = unmarshal(gson, OptionalTypeAdapterModel.class, "{}");
assertThat(result, is(expected));
}
@Test
public void testRequiredSerializedNameNonNull() {
SerializedNameModel expected = new SerializedNameModel();
expected.bar = "hello world";
SerializedNameModel result = unmarshal(gson, SerializedNameModel.class, marshal(gson, expected));
assertThat(result, is(expected));
}
@Test
public void testRequiredSerializedNameNull() {
SerializedNameModel expected = new SerializedNameModel();
SerializedNameModel result = unmarshal(gson, SerializedNameModel.class, marshal(gson, expected));
assertThat(result, nullValue());
}
@Test
public void testRequiredSerializedNameMissing() {
SerializedNameModel result = unmarshal(gson, SerializedNameModel.class, "{}");
assertThat(result, nullValue());
}
@Test
public void testComposedValid() {
RequiredModel required = new RequiredModel();
required.field = 1;
OptionalModel optional = new OptionalModel();
ComposedModel expected = new ComposedModel();
expected.required = required;
expected.optional = optional;
ComposedModel result = unmarshal(gson, ComposedModel.class, marshal(gson, expected));
assertThat(result, is(expected));
}
@Test
public void testComposedInvalid() {
RequiredModel required = new RequiredModel();
OptionalModel optional = new OptionalModel();
ComposedModel aggregated = new ComposedModel();
aggregated.required = required;
aggregated.optional = optional;
ComposedModel result = unmarshal(gson, ComposedModel.class, marshal(gson, aggregated));
assertThat(result, nullValue());
}
private static class RequiredModel extends BaseModel {
@SuppressWarnings("NullableProblems") @Required @NonNull private Integer field;
}
private static class OptionalModel extends BaseModel {
@Nullable private Integer field;
}
private static class ComposedModel extends BaseModel {
@SuppressWarnings("NullableProblems") @Required @NonNull private RequiredModel required;
@Nullable private OptionalModel optional;
}
private static class RequiredTypeAdapterModel extends BaseModel {
@SuppressWarnings("NullableProblems") @Required @NonNull private Uri uri;
}
private static class OptionalTypeAdapterModel extends BaseModel {
@Nullable private Uri uri;
}
private static class SerializedNameModel extends BaseModel {
@SuppressWarnings("NullableProblems") @SerializedName("foo") @Required @NonNull private String bar;
}
}

View file

@ -0,0 +1,64 @@
package org.wikipedia.json;
import android.net.Uri;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.ParameterizedRobolectricTestRunner;
import org.robolectric.ParameterizedRobolectricTestRunner.Parameters;
import org.wikipedia.dataclient.Service;
import java.util.Arrays;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.wikipedia.json.GsonMarshaller.marshal;
import static org.wikipedia.json.GsonUnmarshaller.unmarshal;
@RunWith(ParameterizedRobolectricTestRunner.class) public class UriTypeAdapterTest {
@Parameters(name = "{0}") public static Iterable<Object[]> data() {
return Arrays.asList(new Object[][] {{DeferredParam.NULL}, {DeferredParam.STRING},
{DeferredParam.OPAQUE}, {DeferredParam.HIERARCHICAL}});
}
@Nullable private final Uri uri;
public UriTypeAdapterTest(@NonNull DeferredParam param) {
this.uri = param.val();
}
@Test public void testWriteRead() {
Uri result = unmarshal(Uri.class, marshal(uri));
assertThat(result, is(uri));
}
// Namespace uses a roboelectric mocked class internally, SparseArray, which is unavailable at
// static time; defer evaluation until TestRunner is executed
private enum DeferredParam {
NULL() {
@Nullable @Override Uri val() {
return null;
}
},
STRING() {
@Nullable @Override Uri val() {
return Uri.parse(Service.WIKIPEDIA_URL);
}
},
OPAQUE() {
@Nullable @Override Uri val() {
return Uri.fromParts("http", "mediawiki.org", null);
}
},
HIERARCHICAL() {
@Nullable @Override Uri val() {
return Uri.EMPTY;
}
};
@Nullable abstract Uri val();
}
}

View file

@ -0,0 +1,48 @@
package org.wikipedia.json;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.wikipedia.dataclient.WikiSite;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.wikipedia.json.GsonMarshaller.marshal;
import static org.wikipedia.json.GsonUnmarshaller.unmarshal;
@RunWith(RobolectricTestRunner.class) public class WikiSiteTypeAdapterTest {
@Test public void testWriteRead() {
WikiSite wiki = WikiSite.forLanguageCode("test");
assertThat(unmarshal(WikiSite.class, marshal(wiki)), is(wiki));
}
@Test public void testReadNull() {
assertThat(unmarshal(WikiSite.class, null), nullValue());
}
@Test public void testReadLegacyString() {
String json = "\"https://test.wikipedia.org\"";
WikiSite expected = WikiSite.forLanguageCode("test");
assertThat(unmarshal(WikiSite.class, json), is(expected));
}
@Test public void testReadLegacyUri() {
String json = "{\"domain\": \"test.wikipedia.org\", \"languageCode\": \"test\"}";
WikiSite expected = WikiSite.forLanguageCode("test");
assertThat(unmarshal(WikiSite.class, json), is(expected));
}
@Test public void testReadLegacyUriLang() {
String json = "{\"domain\": \"test.wikipedia.org\"}";
WikiSite expected = WikiSite.forLanguageCode("test");
assertThat(unmarshal(WikiSite.class, json), is(expected));
}
@Test public void testReadLegacyLang() {
String json = "{\"domain\": \"https://test.wikipedia.org\"}";
WikiSite expected = WikiSite.forLanguageCode("test");
assertThat(unmarshal(WikiSite.class, json), is(expected));
}
}

View file

@ -0,0 +1,60 @@
package org.wikipedia.language;
import com.google.gson.stream.MalformedJsonException;
import org.junit.Test;
import org.wikipedia.dataclient.mwapi.MwQueryResponse;
import org.wikipedia.test.MockRetrofitTest;
import io.reactivex.Observable;
import io.reactivex.observers.TestObserver;
public class LangLinksClientTest extends MockRetrofitTest {
@Test
public void testRequestSuccessHasResults() throws Throwable {
enqueueFromFile("lang_links.json");
TestObserver<MwQueryResponse> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result ->
result.query().langLinks().get(0).getDisplayText().equals("Sciëntologie"));
}
@Test
public void testRequestSuccessNoResults() throws Throwable {
enqueueFromFile("lang_links_empty.json");
TestObserver<MwQueryResponse> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.query().langLinks().isEmpty());
}
@Test
public void testRequestResponseApiError() throws Throwable {
enqueueFromFile("api_error.json");
TestObserver<MwQueryResponse> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(Exception.class);
}
@Test
public void testRequestResponseMalformed() {
enqueueMalformed();
TestObserver<MwQueryResponse> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(MalformedJsonException.class);
}
private Observable<MwQueryResponse> getObservable() {
return getApiService().getLangLinks("foo");
}
}

View file

@ -0,0 +1,44 @@
package org.wikipedia.login;
import com.google.gson.stream.MalformedJsonException;
import org.junit.Test;
import org.wikipedia.dataclient.mwapi.MwQueryResponse;
import org.wikipedia.test.MockRetrofitTest;
import io.reactivex.Observable;
import io.reactivex.observers.TestObserver;
public class UserExtendedInfoClientTest extends MockRetrofitTest {
@Test public void testRequestSuccess() throws Throwable {
enqueueFromFile("user_extended_info.json");
TestObserver<MwQueryResponse> observer = new TestObserver<>();
getObservable().subscribe(observer);
final int id = 24531888;
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.query().userInfo().id() == id
&& result.query().getUserResponse("USER").name().equals("USER"));
}
@Test public void testRequestResponse404() {
enqueue404();
TestObserver<MwQueryResponse> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(Exception.class);
}
@Test public void testRequestResponseMalformed() {
enqueueMalformed();
TestObserver<MwQueryResponse> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(MalformedJsonException.class);
}
private Observable<MwQueryResponse> getObservable() {
return getApiService().getUserInfo("USER");
}
}

View file

@ -0,0 +1,23 @@
package org.wikipedia.media;
import org.junit.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.wikipedia.dataclient.Service.PREFERRED_THUMB_SIZE;
import static org.wikipedia.util.ImageUrlUtil.getUrlForSize;
public class ImageUrlTest {
// Should rewrite URLs for larger images to the desired width, but leave smaller images and
// image URLs with no width alone.
@Test public void testImageUrlRewriting() {
String url1024 = "https://upload.wikimedia.org/wikipedia/commons/thumb/9/90/Istanbul_Airport_Turkish-Airlines_2013-11-18.JPG/1024px-Istanbul_Airport_Turkish-Airlines_2013-11-18.JPG";
String url320 = "https://upload.wikimedia.org/wikipedia/commons/thumb/9/90/Istanbul_Airport_Turkish-Airlines_2013-11-18.JPG/320px-Istanbul_Airport_Turkish-Airlines_2013-11-18.JPG";
String url244 = "https://upload.wikimedia.org/wikipedia/commons/thumb/9/94/People%27s_Party_%28Spain%29_Logo.svg/244px-People%27s_Party_%28Spain%29_Logo.svg.png";
String urlNoWidth = "https://upload.wikimedia.org/wikipedia/commons/6/6a/Mariano_Rajoy_2015e_%28cropped%29.jpg";
assertThat(getUrlForSize(url1024, PREFERRED_THUMB_SIZE), is(url320));
assertThat(getUrlForSize(url244, PREFERRED_THUMB_SIZE), is(url244));
assertThat(getUrlForSize(urlNoWidth, PREFERRED_THUMB_SIZE), is(urlNoWidth));
}
}

View file

@ -0,0 +1,108 @@
package org.wikipedia.nearby;
import com.google.gson.stream.MalformedJsonException;
import org.junit.Test;
import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.dataclient.mwapi.MwException;
import org.wikipedia.dataclient.mwapi.MwQueryResponse;
import org.wikipedia.dataclient.mwapi.NearbyPage;
import org.wikipedia.test.MockRetrofitTest;
import java.util.Collections;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.functions.Function;
import io.reactivex.observers.TestObserver;
@SuppressWarnings("checkstyle:magicnumber")
public class NearbyClientTest extends MockRetrofitTest {
@Test public void testRequestSuccessHasResults() throws Throwable {
enqueueFromFile("nearby.json");
TestObserver<List<NearbyPage>> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(nearbyPages -> nearbyPages.get(0).getTitle().getDisplayText().equals("Bean Hollow State Beach")
&& nearbyPages.get(0).getLocation().getLatitude() == 37.22583333
&& nearbyPages.get(0).getLocation().getLongitude() == -122.40888889);
}
@Test public void testRequestNoResults() throws Throwable {
enqueueFromFile("nearby_empty.json");
TestObserver<List<NearbyPage>> observer = new TestObserver<>();
getApiService().nearbySearch("0|0", 1)
.map((Function<MwQueryResponse, List<NearbyPage>>) response
-> response.query() != null ? response.query().nearbyPages(WikiSite.forLanguageCode("en")) : Collections.emptyList())
.subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(List::isEmpty);
}
@Test public void testLocationMissingCoordsIsExcludedFromResults() throws Throwable {
enqueueFromFile("nearby_missing_coords.json");
TestObserver<List<NearbyPage>> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(List::isEmpty);
}
@Test public void testLocationMissingLatOnlyIsExcludedFromResults() throws Throwable {
enqueueFromFile("nearby_missing_lat.json");
TestObserver<List<NearbyPage>> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(List::isEmpty);
}
@Test public void testLocationMissingLonOnlyIsExcludedFromResults() throws Throwable {
enqueueFromFile("nearby_missing_lon.json");
TestObserver<List<NearbyPage>> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(List::isEmpty);
}
@Test public void testRequestResponseApiError() throws Throwable {
enqueueFromFile("api_error.json");
TestObserver<List<NearbyPage>> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(MwException.class);
}
@Test public void testRequestResponseFailure() {
enqueue404();
TestObserver<List<NearbyPage>> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(Exception.class);
}
@Test public void testRequestResponseMalformed() {
enqueueMalformed();
TestObserver<List<NearbyPage>> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(MalformedJsonException.class);
}
private Observable<List<NearbyPage>> getObservable() {
return getApiService().nearbySearch("0|0", 1)
.map(response -> response.query().nearbyPages(WikiSite.forLanguageCode("en")));
}
}

View file

@ -0,0 +1,120 @@
package org.wikipedia.nearby;
import android.location.Location;
import androidx.annotation.NonNull;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.wikipedia.dataclient.Service;
import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.dataclient.mwapi.NearbyPage;
import org.wikipedia.page.PageTitle;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
/**
* Unit tests for Nearby related classes. Probably should refactor this into a model class.
*/
@SuppressWarnings("checkstyle:magicnumber") @RunWith(RobolectricTestRunner.class)
public class NearbyUnitTest {
private static WikiSite TEST_WIKI_SITE = new WikiSite(Service.WIKIPEDIA_URL);
/** dist(origin, point a) */
private static final int A = 111_319;
private Location nextLocation;
private List<NearbyPage> nearbyPages;
@Before
public void setUp() {
nextLocation = new Location("current");
nextLocation.setLatitude(0.0d);
nextLocation.setLongitude(0.0d);
nearbyPages = new LinkedList<>();
nearbyPages.add(constructNearbyPage("c", 0.0, 3.0));
nearbyPages.add(constructNearbyPage("b", 0.0, 2.0));
nearbyPages.add(constructNearbyPage("a", 0.0, 1.0));
}
@Test public void testSort() {
calcDistances(nearbyPages);
Collections.sort(nearbyPages, new NearbyDistanceComparator());
assertThat("a", is(nearbyPages.get(0).getTitle().getDisplayText()));
assertThat("b", is(nearbyPages.get(1).getTitle().getDisplayText()));
assertThat("c", is(nearbyPages.get(2).getTitle().getDisplayText()));
}
@Test public void testSortWithNullLocations() {
final Location location = null;
nearbyPages.add(new NearbyPage(new PageTitle("d", TEST_WIKI_SITE), location));
nearbyPages.add(new NearbyPage(new PageTitle("e", TEST_WIKI_SITE), location));
calcDistances(nearbyPages);
Collections.sort(nearbyPages, new NearbyDistanceComparator());
assertThat("a", is(nearbyPages.get(0).getTitle().getDisplayText()));
assertThat("b", is(nearbyPages.get(1).getTitle().getDisplayText()));
assertThat("c", is(nearbyPages.get(2).getTitle().getDisplayText()));
// the two null location values come last but in the same order as from the original list:
assertThat("d", is(nearbyPages.get(3).getTitle().getDisplayText()));
assertThat("e", is(nearbyPages.get(4).getTitle().getDisplayText()));
}
@Test public void testCompare() {
final Location location = null;
NearbyPage nullLocPage = new NearbyPage(new PageTitle("nowhere", TEST_WIKI_SITE), location);
calcDistances(nearbyPages);
nullLocPage.setDistance(getDistance(nullLocPage.getLocation()));
assertThat(Integer.MAX_VALUE, is(nullLocPage.getDistance()));
NearbyDistanceComparator comp = new NearbyDistanceComparator();
assertThat(A, is(comp.compare(nearbyPages.get(1), nearbyPages.get(2))));
assertThat(-1 * A, is(comp.compare(nearbyPages.get(2), nearbyPages.get(1))));
assertThat(Integer.MAX_VALUE - A, is(comp.compare(nullLocPage, nearbyPages.get(2))));
assertThat((Integer.MIN_VALUE + 1) + A, is(comp.compare(nearbyPages.get(2), nullLocPage))); // - (max - a)
assertThat(0, is(comp.compare(nullLocPage, nullLocPage)));
}
private class NearbyDistanceComparator implements Comparator<NearbyPage> {
@Override
public int compare(NearbyPage a, NearbyPage b) {
return a.getDistance() - b.getDistance();
}
}
//
// UGLY: copy of production code
//
/**
* Calculates the distances from the origin to the given pages.
* This method should be called before sorting.
*/
private void calcDistances(List<NearbyPage> pages) {
for (NearbyPage page : pages) {
page.setDistance(getDistance(page.getLocation()));
}
}
private int getDistance(Location otherLocation) {
if (otherLocation == null) {
return Integer.MAX_VALUE;
} else {
return (int) nextLocation.distanceTo(otherLocation);
}
}
private NearbyPage constructNearbyPage(@NonNull String title, double lat, double lon) {
Location location = new Location("");
location.setLatitude(lat);
location.setLongitude(lon);
return new NearbyPage(new PageTitle(title, TEST_WIKI_SITE), location);
}
}

View file

@ -0,0 +1,57 @@
package org.wikipedia.notifications;
import com.google.gson.stream.MalformedJsonException;
import org.junit.Test;
import org.wikipedia.dataclient.mwapi.MwQueryResponse;
import org.wikipedia.json.GsonUnmarshaller;
import org.wikipedia.test.MockRetrofitTest;
import org.wikipedia.test.TestFileUtil;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.observers.TestObserver;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
public class NotificationClientTest extends MockRetrofitTest {
@Test public void testRequestSuccess() throws Throwable {
enqueueFromFile("notifications.json");
TestObserver<MwQueryResponse> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(response -> {
List<Notification> notifications = response.query().notifications().list();
return notifications.get(0).type().equals("edit-thank")
&& notifications.get(0).title().full().equals("PageTitle")
&& notifications.get(0).agent().name().equals("User1");
});
}
@Test public void testRequestMalformed() {
enqueueMalformed();
TestObserver<MwQueryResponse> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(MalformedJsonException.class);
}
@Test public void testNotificationReverted() throws Throwable {
String json = TestFileUtil.readRawFile("notification_revert.json");
Notification n = GsonUnmarshaller.unmarshal(Notification.class, json);
assertThat(n.type(), is(Notification.TYPE_REVERTED));
assertThat(n.wiki(), is("wikidatawiki"));
assertThat(n.agent().name(), is("User1"));
assertThat(n.isFromWikidata(), is(true));
}
private Observable<MwQueryResponse> getObservable() {
return getApiService().getAllNotifications("*", "!read", null);
}
}

View file

@ -0,0 +1,99 @@
package org.wikipedia.page;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.wikipedia.dataclient.WikiSite;
import java.util.Locale;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.wikipedia.page.Namespace.FILE;
import static org.wikipedia.page.Namespace.MAIN;
import static org.wikipedia.page.Namespace.MEDIA;
import static org.wikipedia.page.Namespace.SPECIAL;
import static org.wikipedia.page.Namespace.TALK;
@RunWith(RobolectricTestRunner.class) public class NamespaceTest {
private static Locale PREV_DEFAULT_LOCALE;
@BeforeClass public static void setUp() {
PREV_DEFAULT_LOCALE = Locale.getDefault();
Locale.setDefault(Locale.ENGLISH);
}
@AfterClass public static void tearDown() {
Locale.setDefault(PREV_DEFAULT_LOCALE);
}
@Test public void testOf() {
assertThat(Namespace.of(SPECIAL.code()), is(SPECIAL));
}
@Test public void testFromLegacyStringMain() {
//noinspection deprecation
assertThat(Namespace.fromLegacyString(WikiSite.forLanguageCode("test"), null), is(MAIN));
}
@Test public void testFromLegacyStringFile() {
//noinspection deprecation
assertThat(Namespace.fromLegacyString(WikiSite.forLanguageCode("he"), "קובץ"), is(FILE));
}
@Test public void testFromLegacyStringSpecial() {
//noinspection deprecation
assertThat(Namespace.fromLegacyString(WikiSite.forLanguageCode("lez"), "Служебная"), is(SPECIAL));
}
@Test public void testFromLegacyStringTalk() {
//noinspection deprecation
assertThat(Namespace.fromLegacyString(WikiSite.forLanguageCode("en"), "stringTalk"), is(TALK));
}
@Test public void testCode() {
assertThat(MAIN.code(), is(0));
assertThat(TALK.code(), is(1));
}
@Test public void testSpecial() {
assertThat(SPECIAL.special(), is(true));
assertThat(MAIN.special(), is(false));
}
@Test public void testMain() {
assertThat(MAIN.main(), is(true));
assertThat(TALK.main(), is(false));
}
@Test public void testFile() {
assertThat(FILE.file(), is(true));
assertThat(MAIN.file(), is(false));
}
@Test public void testTalkNegative() {
assertThat(MEDIA.talk(), is(false));
assertThat(SPECIAL.talk(), is(false));
}
@Test public void testTalkZero() {
assertThat(MAIN.talk(), is(false));
}
@Test public void testTalkOdd() {
assertThat(TALK.talk(), is(true));
}
@Test public void testToLegacyStringMain() {
//noinspection deprecation
assertThat(MAIN.toLegacyString(), nullValue());
}
@Test public void testToLegacyStringNonMain() {
//noinspection deprecation
assertThat(TALK.toLegacyString(), is("Talk"));
}
}

View file

@ -0,0 +1,35 @@
package org.wikipedia.page;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.wikipedia.dataclient.WikiSite;
import java.util.ArrayList;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
/** Unit tests for Page. */
@RunWith(RobolectricTestRunner.class)
public class PageTest {
private static final WikiSite WIKI = WikiSite.forLanguageCode("en");
@Test
public void testMediaWikiMarshalling() {
PageTitle title = new PageTitle("Main page", WIKI, "//foo/thumb.jpg");
PageProperties props = new PageProperties(title, true);
Page page = new Page(title, new ArrayList<>(), props, false);
assertThat(page.isFromRestBase(), is(false));
}
@Test
public void testRestBaseMarshalling() {
PageTitle title = new PageTitle("Main page", WIKI, "//foo/thumb.jpg");
PageProperties props = new PageProperties(title, true);
Page page = new Page(title, new ArrayList<>(), props, true);
assertThat(page.isFromRestBase(), is(true));
}
}

View file

@ -0,0 +1,139 @@
package org.wikipedia.page;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.wikipedia.dataclient.WikiSite;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@RunWith(RobolectricTestRunner.class) public class PageTitleTest {
@Test public void testEquals() {
assertThat(new PageTitle(null, "India", WikiSite.forLanguageCode("en")).equals(new PageTitle(null, "India", WikiSite.forLanguageCode("en"))), is(true));
assertThat(new PageTitle("Talk", "India", WikiSite.forLanguageCode("en")).equals(new PageTitle("Talk", "India", WikiSite.forLanguageCode("en"))), is(true));
assertThat(new PageTitle(null, "India", WikiSite.forLanguageCode("ta")).equals(new PageTitle(null, "India", WikiSite.forLanguageCode("en"))), is(false));
assertThat(new PageTitle("Talk", "India", WikiSite.forLanguageCode("ta")).equals(new PageTitle("Talk", "India", WikiSite.forLanguageCode("en"))), is(false));
assertThat(new PageTitle("Talk", "India", WikiSite.forLanguageCode("ta")).equals("Something else"), is(false));
}
@Test public void testPrefixedText() {
WikiSite enwiki = WikiSite.forLanguageCode("en");
assertThat(new PageTitle(null, "Test title", enwiki).getPrefixedText(), is("Test__title"));
assertThat(new PageTitle(null, "Test title", enwiki).getPrefixedText(), is("Test_title"));
assertThat(new PageTitle("Talk", "Test title", enwiki).getPrefixedText(), is("Talk:Test_title"));
assertThat(new PageTitle(null, "Test title", enwiki).getText(), is("Test_title"));
}
@Test public void testFromInternalLink() {
WikiSite enwiki = WikiSite.forLanguageCode("en");
assertThat(enwiki.titleForInternalLink("/wiki/India").getPrefixedText(), is("India"));
assertThat(enwiki.titleForInternalLink("/wiki/India").getNamespace(), nullValue());
assertThat(enwiki.titleForInternalLink("/wiki/Talk:India").getNamespace(), is("Talk"));
assertThat(enwiki.titleForInternalLink("/wiki/Talk:India").getText(), is("India"));
assertThat(enwiki.titleForInternalLink("/wiki/Talk:India").getFragment(), nullValue());
assertThat(enwiki.titleForInternalLink("/wiki/Talk:India#").getNamespace(), is("Talk"));
assertThat(enwiki.titleForInternalLink("/wiki/Talk:India#").getText(), is("India"));
assertThat(enwiki.titleForInternalLink("/wiki/Talk:India#").getFragment(), is(""));
assertThat(enwiki.titleForInternalLink("/wiki/Talk:India#History").getNamespace(), is("Talk"));
assertThat(enwiki.titleForInternalLink("/wiki/Talk:India#History").getText(), is("India"));
assertThat(enwiki.titleForInternalLink("/wiki/Talk:India#History").getFragment(), is("History"));
}
@Test public void testCanonicalURL() {
WikiSite enwiki = WikiSite.forLanguageCode("en");
assertThat(enwiki.titleForInternalLink("/wiki/India").getCanonicalUri(), is("https://en.wikipedia.org/wiki/India"));
assertThat(enwiki.titleForInternalLink("/wiki/India Gate").getCanonicalUri(), is("https://en.wikipedia.org/wiki/India_Gate"));
assertThat(enwiki.titleForInternalLink("/wiki/India's Gate").getCanonicalUri(), is("https://en.wikipedia.org/wiki/India%27s_Gate"));
}
@Test public void testWikiSite() {
WikiSite enwiki = WikiSite.forLanguageCode("en");
assertThat(new PageTitle(null, "Test", enwiki).getWikiSite(), is(enwiki));
assertThat(WikiSite.forLanguageCode("en"), is(enwiki));
}
@Test public void testParsing() {
WikiSite enwiki = WikiSite.forLanguageCode("en");
assertThat(new PageTitle("Hello", enwiki).getDisplayText(), is("Hello"));
assertThat(new PageTitle("Talk:Hello", enwiki).getDisplayText(), is("Talk:Hello"));
assertThat(new PageTitle("Talk:Hello", enwiki).getText(), is("Hello"));
assertThat(new PageTitle("Talk:Hello", enwiki).getNamespace(), is("Talk"));
assertThat(new PageTitle("Wikipedia_talk:Hello world", enwiki).getDisplayText(), is("Wikipedia talk:Hello world"));
}
@Test public void testSpecial() {
assertThat(new PageTitle("Special:Version", WikiSite.forLanguageCode("en")).isSpecial(), is(true));
assertThat(new PageTitle("特別:Version", WikiSite.forLanguageCode("ja")).isSpecial(), is(true));
assertThat(new PageTitle("Special:Version", WikiSite.forLanguageCode("ja")).isSpecial(), is(true));
assertThat(new PageTitle("特別:Version", WikiSite.forLanguageCode("en")).isSpecial(), is(false));
}
@Test public void testFile() {
assertThat(new PageTitle("File:SomethingSomething", WikiSite.forLanguageCode("en")).isFilePage(), is(true));
assertThat(new PageTitle("ファイル:Version", WikiSite.forLanguageCode("ja")).isFilePage(), is(true));
assertThat(new PageTitle("File:SomethingSomething", WikiSite.forLanguageCode("ja")).isFilePage(), is(true));
assertThat(new PageTitle("ファイル:Version", WikiSite.forLanguageCode("en")).isFilePage(), is(false));
}
@Test public void testIsMainPageNoTitleNoProps() {
final String text = null;
WikiSite wiki = WikiSite.forLanguageCode("test");
final String thumbUrl = null;
final String desc = null;
final PageProperties props = null;
PageTitle subject = new PageTitle(text, wiki, thumbUrl, desc, props);
assertThat(subject.isMainPage(), is(false));
}
@Test public void testIsMainPageTitleNoProps() {
String text = "text";
WikiSite wiki = WikiSite.forLanguageCode("test");
final String thumbUrl = null;
final String desc = null;
final PageProperties props = null;
PageTitle subject = new PageTitle(text, wiki, thumbUrl, desc, props);
assertThat(subject.isMainPage(), is(false));
}
@Test public void testIsMainPageProps() {
String text = "text";
WikiSite wiki = WikiSite.forLanguageCode("test");
final String thumbUrl = null;
final String desc = null;
PageProperties props = mock(PageProperties.class);
when(props.isMainPage()).thenReturn(true);
PageTitle subject = new PageTitle(text, wiki, thumbUrl, desc, props);
assertThat(subject.isMainPage(), is(true));
}
/** https://bugzilla.wikimedia.org/66151 */
@Test public void testHashChar() {
PageTitle pageTitle = new PageTitle("#", WikiSite.forLanguageCode("en"));
assertThat(pageTitle.getNamespace(), nullValue());
assertThat(pageTitle.getText(), is(""));
assertThat(pageTitle.getFragment(), is(""));
}
@Test public void testColonChar() {
PageTitle pageTitle = new PageTitle(":", WikiSite.forLanguageCode("en"));
assertThat(pageTitle.getNamespace(), is(""));
assertThat(pageTitle.getText(), is(""));
assertThat(pageTitle.getFragment(), nullValue());
}
}

View file

@ -0,0 +1,30 @@
package org.wikipedia.page;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
@RunWith(RobolectricTestRunner.class) public class SectionTest {
@Test public void testSectionLead() {
// Section 0 is the lead
Section section = new Section(0, 0, "Heading", "Heading", "Content");
assertThat(section.isLead(), is(true));
// Section 1 is not
section = new Section(1, 1, "Heading", "Heading", "Content");
assertThat(section.isLead(), is(false));
// Section 1 is not, even if it's somehow at level 0
section = new Section(1, 0, "Heading", "Heading", "Content");
assertThat(section.isLead(), is(false));
}
@Test public void testJSONSerialization() {
Section parentSection = new Section(1, 1, null, null, "Hi there!");
assertThat(parentSection, is(Section.fromJson(parentSection.toJSON())));
}
}

View file

@ -0,0 +1,46 @@
package org.wikipedia.random;
import com.google.gson.stream.MalformedJsonException;
import org.junit.Test;
import org.wikipedia.dataclient.restbase.page.RbPageSummary;
import org.wikipedia.test.MockRetrofitTest;
import io.reactivex.Observable;
import io.reactivex.observers.TestObserver;
public class RandomSummaryClientTest extends MockRetrofitTest {
@Test
public void testRequestEligible() throws Throwable {
enqueueFromFile("rb_page_summary_valid.json");
TestObserver<RbPageSummary> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(summary -> summary != null
&& summary.getDisplayTitle().equals("Fermat's Last Theorem")
&& summary.getDescription().equals("theorem in number theory"));
}
@Test public void testRequestMalformed() {
enqueueMalformed();
TestObserver<RbPageSummary> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(MalformedJsonException.class);
}
@Test public void testRequestFailure() {
enqueue404();
TestObserver<RbPageSummary> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(Exception.class);
}
private Observable<RbPageSummary> getObservable() {
return getRestService().getRandomSummary();
}
}

View file

@ -0,0 +1,80 @@
package org.wikipedia.search;
import com.google.gson.stream.MalformedJsonException;
import org.junit.Test;
import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.test.MockRetrofitTest;
import io.reactivex.Observable;
import io.reactivex.observers.TestObserver;
public class FullTextSearchClientTest extends MockRetrofitTest {
private static final WikiSite TESTWIKI = new WikiSite("test.wikimedia.org");
private static final int BATCH_SIZE = 20;
private Observable<SearchResults> getObservable() {
return getApiService().fullTextSearch("foo", BATCH_SIZE, null, null)
.map(response -> {
if (response.success()) {
// noinspection ConstantConditions
return new SearchResults(response.query().pages(), TESTWIKI,
response.continuation(), null);
}
return new SearchResults();
});
}
@Test public void testRequestSuccessNoContinuation() throws Throwable {
enqueueFromFile("full_text_search_results.json");
TestObserver<SearchResults> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.getResults().get(0).getPageTitle().getDisplayText().equals("IND Queens Boulevard Line"));
}
@Test public void testRequestSuccessWithContinuation() throws Throwable {
enqueueFromFile("full_text_search_results.json");
TestObserver<SearchResults> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.getContinuation().get("continue").equals("gsroffset||")
&& result.getContinuation().get("gsroffset").equals("20"));
}
@Test public void testRequestSuccessNoResults() throws Throwable {
enqueueFromFile("full_text_search_results_empty.json");
TestObserver<SearchResults> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.getResults().isEmpty());
}
@Test public void testRequestResponseApiError() throws Throwable {
enqueueFromFile("api_error.json");
TestObserver<SearchResults> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(Exception.class);
}
@Test public void testRequestResponseFailure() {
enqueue404();
TestObserver<SearchResults> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(Exception.class);
}
@Test public void testRequestResponseMalformed() {
enqueueMalformed();
TestObserver<SearchResults> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(MalformedJsonException.class);
}
}

View file

@ -0,0 +1,69 @@
package org.wikipedia.search;
import com.google.gson.stream.MalformedJsonException;
import org.junit.Test;
import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.test.MockRetrofitTest;
import io.reactivex.Observable;
import io.reactivex.observers.TestObserver;
public class PrefixSearchClientTest extends MockRetrofitTest {
private static final WikiSite TESTWIKI = new WikiSite("test.wikimedia.org");
private static final int BATCH_SIZE = 20;
private Observable<SearchResults> getObservable() {
return getApiService().prefixSearch("foo", BATCH_SIZE, "foo")
.map(response -> {
if (response != null && response.success() && response.query().pages() != null) {
// noinspection ConstantConditions
return new SearchResults(response.query().pages(), TESTWIKI, response.continuation(),
response.suggestion());
}
return new SearchResults();
});
}
@Test public void testRequestSuccess() throws Throwable {
enqueueFromFile("prefix_search_results.json");
TestObserver<SearchResults> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.getResults().get(0).getPageTitle().getDisplayText().equals("Narthecium"));
}
@Test public void testRequestSuccessNoResults() throws Throwable {
enqueueFromFile("prefix_search_results_empty.json");
TestObserver<SearchResults> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.getResults().isEmpty());
}
@Test public void testRequestResponseApiError() throws Throwable {
enqueueFromFile("api_error.json");
TestObserver<SearchResults> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(Exception.class);
}
@Test public void testRequestResponseFailure() {
enqueue404();
TestObserver<SearchResults> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(Exception.class);
}
@Test public void testRequestResponseMalformed() {
enqueueMalformed();
TestObserver<SearchResults> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(MalformedJsonException.class);
}
}

View file

@ -0,0 +1,81 @@
package org.wikipedia.search;
import com.google.gson.stream.MalformedJsonException;
import org.junit.Test;
import org.wikipedia.dataclient.restbase.RbRelatedPages;
import org.wikipedia.dataclient.restbase.page.RbPageSummary;
import org.wikipedia.test.MockRetrofitTest;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.observers.TestObserver;
public class RelatedPagesSearchClientTest extends MockRetrofitTest {
private static final String RAW_JSON_FILE = "related_pages_search_results.json";
@Test
@SuppressWarnings("checkstyle:magicnumber")
public void testRequestSuccessWithNoLimit() throws Throwable {
enqueueFromFile(RAW_JSON_FILE);
TestObserver<List<RbPageSummary>> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.size() == 5
&& result.get(4).getThumbnailUrl().equals("https://upload.wikimedia.org/wikipedia/commons/thumb/8/8e/Vizsla_r%C3%A1h%C3%BAz_a_vadra.jpg/320px-Vizsla_r%C3%A1h%C3%BAz_a_vadra.jpg")
&& result.get(4).getDisplayTitle().equals("Dog intelligence")
&& result.get(4).getDescription() == null);
}
@Test
@SuppressWarnings("checkstyle:magicnumber")
public void testRequestSuccessWithLimit() throws Throwable {
enqueueFromFile(RAW_JSON_FILE);
TestObserver<List<RbPageSummary>> observer = new TestObserver<>();
getRestService().getRelatedPages("foo")
.map(response -> response.getPages(3))
.subscribe(observer);
observer.assertComplete().assertNoErrors()
.assertValue(result -> result.size() == 3
&& result.get(0).getThumbnailUrl().equals("https://upload.wikimedia.org/wikipedia/commons/thumb/a/ab/European_grey_wolf_in_Prague_zoo.jpg/291px-European_grey_wolf_in_Prague_zoo.jpg")
&& result.get(0).getDisplayTitle().equals("Wolf")
&& result.get(0).getDescription().equals("species of mammal"));
}
@Test public void testRequestResponseApiError() throws Throwable {
enqueueFromFile("api_error.json");
TestObserver<List<RbPageSummary>> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(Exception.class);
}
@Test public void testRequestResponseFailure() {
enqueue404();
TestObserver<List<RbPageSummary>> observer = new TestObserver<>();
getRestService().getRelatedPages("foo")
.map(RbRelatedPages::getPages)
.subscribe(observer);
observer.assertError(Exception.class);
}
@Test public void testRequestResponseMalformed() {
enqueueMalformed();
TestObserver<List<RbPageSummary>> observer = new TestObserver<>();
getObservable().subscribe(observer);
observer.assertError(MalformedJsonException.class);
}
private Observable<List<RbPageSummary>> getObservable() {
return getRestService().getRelatedPages("foo").map(RbRelatedPages::getPages);
}
}

View file

@ -0,0 +1,90 @@
package org.wikipedia.search;
import org.junit.Before;
import org.junit.Test;
import org.wikipedia.dataclient.mwapi.MwQueryResult;
import org.wikipedia.json.GsonUtil;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
public class SearchResultsRedirectProcessingTest {
private MwQueryResult result;
@Before public void setUp() {
result = GsonUtil.getDefaultGson().fromJson(queryJson, MwQueryResult.class);
}
@Test public void testRedirectHandling() {
assertThat(result.pages().size(), is(2));
assertThat(result.pages().get(0).title(), is("Narthecium#Foo"));
assertThat(result.pages().get(0).redirectFrom(), is("Abama"));
assertThat(result.pages().get(1).title(), is("Amitriptyline"));
assertThat(result.pages().get(1).redirectFrom(), is("Abamax"));
}
@Test public void testConvertTitleHandling() {
assertThat(result.pages().size(), is(2));
assertThat(result.pages().get(0).title(), is("Narthecium#Foo"));
assertThat(result.pages().get(0).convertedFrom(), is("NotNarthecium"));
}
private String queryJson = "{\n"
+ " \"converted\": [\n"
+ " {\n"
+ " \"from\": \"NotNarthecium\",\n"
+ " \"to\": \"Narthecium\"\n"
+ " }\n"
+ " ],\n"
+ " \"redirects\": [\n"
+ " {\n"
+ " \"index\": 1,\n"
+ " \"from\": \"Abama\",\n"
+ " \"to\": \"Narthecium\",\n"
+ " \"tofragment\": \"Foo\"\n"
+ " },\n"
+ " {\n"
+ " \"index\": 2,\n"
+ " \"from\": \"Abamax\",\n"
+ " \"to\": \"Amitriptyline\"\n"
+ " }\n"
+ " ],\n"
+ " \"pages\":[\n"
+ " {\n"
+ " \"pageid\": 2060913,\n"
+ " \"ns\": 0,\n"
+ " \"title\": \"Narthecium\",\n"
+ " \"index\": 1,\n"
+ " \"terms\": {\n"
+ " \"description\": [\n"
+ " \"genus of plants\"\n"
+ " ]\n"
+ " },\n"
+ " \"thumbnail\": {\n"
+ " \"source\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Narthecium_ossifragum_01.jpg/240px-Narthecium_ossifragum_01.jpg\",\n"
+ " \"width\": 240,\n"
+ " \"height\": 320\n"
+ " }\n"
+ " },\n"
+ " {\n"
+ " \"pageid\": 583678,\n"
+ " \"ns\": 0,\n"
+ " \"title\": \"Amitriptyline\",\n"
+ " \"index\": 2,\n"
+ " \"terms\": {\n"
+ " \"description\": [\n"
+ " \"chemical compound\",\n"
+ " \"chemical compound\"\n"
+ " ]\n"
+ " },\n"
+ " \"thumbnail\": {\n"
+ " \"source\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/6/68/Amitriptyline2DACS.svg/318px-Amitriptyline2DACS.svg.png\",\n"
+ " \"width\": 318,\n"
+ " \"height\": 320\n"
+ " }\n"
+ " }\n"
+ " ]\n"
+ " }";
}

View file

@ -0,0 +1,12 @@
package org.wikipedia.test;
import androidx.annotation.NonNull;
import java.util.concurrent.Executor;
public class ImmediateExecutor implements Executor {
@Override
public void execute(@NonNull Runnable runnable) {
runnable.run();
}
}

View file

@ -0,0 +1,34 @@
package org.wikipedia.test;
import androidx.annotation.NonNull;
import java.util.List;
import java.util.concurrent.AbstractExecutorService;
import java.util.concurrent.TimeUnit;
public final class ImmediateExecutorService extends AbstractExecutorService {
@Override public void shutdown() {
throw new UnsupportedOperationException();
}
@NonNull @Override public List<Runnable> shutdownNow() {
throw new UnsupportedOperationException();
}
@Override public boolean isShutdown() {
throw new UnsupportedOperationException();
}
@Override public boolean isTerminated() {
throw new UnsupportedOperationException();
}
@Override public boolean awaitTermination(long l, @NonNull TimeUnit timeUnit)
throws InterruptedException {
throw new UnsupportedOperationException();
}
@Override public void execute(@NonNull Runnable runnable) {
runnable.run();
}
}

View file

@ -0,0 +1,60 @@
package org.wikipedia.test;
import android.net.Uri;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.junit.Before;
import org.wikipedia.dataclient.RestService;
import org.wikipedia.dataclient.Service;
import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.json.NamespaceTypeAdapter;
import org.wikipedia.json.PostProcessingTypeAdapter;
import org.wikipedia.json.UriTypeAdapter;
import org.wikipedia.json.WikiSiteTypeAdapter;
import org.wikipedia.page.Namespace;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
public abstract class MockRetrofitTest extends MockWebServerTest {
private Service apiService;
private RestService restService;
private WikiSite wikiSite = WikiSite.forLanguageCode("en");
protected WikiSite wikiSite() {
return wikiSite;
}
@Override
@Before
public void setUp() throws Throwable {
super.setUp();
Retrofit retrofit = new Retrofit.Builder()
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.addConverterFactory(GsonConverterFactory.create(getGson()))
.baseUrl(server().getUrl())
.build();
apiService = retrofit.create(Service.class);
restService = retrofit.create(RestService.class);
}
protected Service getApiService() {
return apiService;
}
protected RestService getRestService() {
return restService;
}
private Gson getGson() {
return new GsonBuilder()
.registerTypeHierarchyAdapter(Uri.class, new UriTypeAdapter().nullSafe())
.registerTypeHierarchyAdapter(Namespace.class, new NamespaceTypeAdapter().nullSafe())
.registerTypeAdapter(WikiSite.class, new WikiSiteTypeAdapter().nullSafe())
.registerTypeAdapterFactory(new PostProcessingTypeAdapter())
.create();
}
}

View file

@ -0,0 +1,76 @@
package org.wikipedia.test;
import androidx.annotation.NonNull;
import org.junit.After;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.wikipedia.AppAdapter;
import org.wikipedia.TestAppAdapter;
import org.wikipedia.dataclient.Service;
import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.json.GsonUtil;
import okhttp3.Dispatcher;
import okhttp3.OkHttpClient;
import okhttp3.mockwebserver.MockResponse;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
@RunWith(RobolectricTestRunner.class)
public abstract class MockWebServerTest {
private OkHttpClient okHttpClient;
private final TestWebServer server = new TestWebServer();
@Before public void setUp() throws Throwable {
AppAdapter.set(new TestAppAdapter());
OkHttpClient.Builder builder = AppAdapter.get().getOkHttpClient(new WikiSite(Service.WIKIPEDIA_URL)).newBuilder();
okHttpClient = builder.dispatcher(new Dispatcher(new ImmediateExecutorService())).build();
server.setUp();
}
@After public void tearDown() throws Throwable {
server.tearDown();
}
@NonNull protected TestWebServer server() {
return server;
}
protected void enqueueFromFile(@NonNull String filename) throws Throwable {
String json = TestFileUtil.readRawFile(filename);
server.enqueue(json);
}
protected void enqueue404() {
final int code = 404;
server.enqueue(new MockResponse().setResponseCode(code).setBody("Not Found"));
}
protected void enqueueMalformed() {
server.enqueue("(╯°□°)╯︵ ┻━┻");
}
protected void enqueueEmptyJson() {
server.enqueue(new MockResponse().setBody("{}"));
}
@NonNull protected OkHttpClient okHttpClient() {
return okHttpClient;
}
@NonNull protected <T> T service(Class<T> clazz) {
return service(clazz, server().getUrl());
}
@NonNull protected <T> T service(Class<T> clazz, @NonNull String url) {
return new Retrofit.Builder()
.baseUrl(url)
.callbackExecutor(new ImmediateExecutor())
.client(okHttpClient)
.addConverterFactory(GsonConverterFactory.create(GsonUtil.getDefaultGson()))
.build()
.create(clazz);
}
}

View file

@ -0,0 +1,40 @@
package org.wikipedia.test;
import android.annotation.TargetApi;
import androidx.annotation.NonNull;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
import java.nio.charset.StandardCharsets;
public final class TestFileUtil {
private static final String RAW_DIR = "src/test/res/raw/";
public static File getRawFile(@NonNull String rawFileName) {
return new File(RAW_DIR + rawFileName);
}
public static String readRawFile(String basename) throws IOException {
return readFile(getRawFile(basename));
}
@TargetApi(19)
private static String readFile(File file) throws IOException {
return FileUtils.readFileToString(file, StandardCharsets.UTF_8);
}
@TargetApi(19)
public static String readStream(InputStream stream) throws IOException {
StringWriter writer = new StringWriter();
IOUtils.copy(stream, writer, StandardCharsets.UTF_8);
return writer.toString();
}
private TestFileUtil() { }
}

View file

@ -0,0 +1,35 @@
package org.wikipedia.test;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.NonNull;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
public final class TestParcelUtil {
/** @param parcelable Must implement hashCode and equals */
public static void test(Parcelable parcelable) throws Throwable {
Parcel parcel = parcel(parcelable);
parcel.setDataPosition(0);
Parcelable unparceled = unparcel(parcel, parcelable.getClass());
assertThat(parcelable, is(unparceled));
}
@NonNull private static Parcelable unparcel(@NonNull Parcel parcel,
Class<? extends Parcelable> clazz) throws Throwable {
Parcelable.Creator<?> creator = (Parcelable.Creator<?>) clazz.getField("CREATOR").get(null);
return (Parcelable) creator.createFromParcel(parcel);
}
@NonNull private static Parcel parcel(@NonNull Parcelable parcelable) {
Parcel parcel = Parcel.obtain();
parcelable.writeToParcel(parcel, 0);
return parcel;
}
private TestParcelUtil() { }
}

View file

@ -0,0 +1,56 @@
package org.wikipedia.test;
import androidx.annotation.NonNull;
import org.wikipedia.TestConstants;
import java.io.IOException;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import okhttp3.mockwebserver.RecordedRequest;
public class TestWebServer {
private final MockWebServer server;
public TestWebServer() {
server = new MockWebServer();
}
public void setUp() throws IOException {
server.start();
}
public void tearDown() throws IOException {
server.shutdown();
}
public String getUrl() {
return getUrl("");
}
public String getUrl(String path) {
return server.url(path).url().toString();
}
public int getRequestCount() {
return server.getRequestCount();
}
public void enqueue(@NonNull String body) {
enqueue(new MockResponse().setBody(body));
}
public void enqueue(MockResponse response) {
server.enqueue(response);
}
@NonNull public RecordedRequest takeRequest() throws InterruptedException {
RecordedRequest req = server.takeRequest(TestConstants.TIMEOUT_DURATION,
TestConstants.TIMEOUT_UNIT);
if (req == null) {
throw new InterruptedException("Timeout elapsed.");
}
return req;
}
}

View file

@ -0,0 +1,28 @@
package org.wikipedia.util;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
@RunWith(RobolectricTestRunner.class)
public class DateUtilTest {
private static final String HTTP_DATE_HEADER = "Thu, 25 May 2017 21:13:47 GMT";
@Test
public void testGetHttpLastModifiedDate() throws Throwable {
assertThat(DateUtil.getExtraShortDateString(DateUtil.getHttpLastModifiedDate(HTTP_DATE_HEADER)), is("May 25"));
}
@Test
public void testIso8601DateFormat() throws Throwable {
assertThat(DateUtil.iso8601DateFormat(DateUtil.getHttpLastModifiedDate(HTTP_DATE_HEADER)), is("2017-05-25T21:13:47Z"));
}
@Test
public void testIso8601Identity() throws Throwable {
assertThat(DateUtil.iso8601DateFormat(DateUtil.iso8601DateParse("2017-05-25T21:13:47Z")), is("2017-05-25T21:13:47Z"));
}
}

View file

@ -0,0 +1,47 @@
package org.wikipedia.util;
import android.net.Uri;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
@RunWith(RobolectricTestRunner.class)
public class ImageUriUtilTest {
private static final int IMAGE_SIZE_1280 = 1280;
private static final int IMAGE_SIZE_200 = 200;
private static final String IMAGE_URL_200 = "https://upload.wikimedia.org/wikipedia/commons/thumb/f/fd/PaeoniaSuffruticosa7.jpg/200px-PaeoniaSuffruticosa7.jpg";
private static final String IMAGE_URL_320 = "https://upload.wikimedia.org/wikipedia/commons/thumb/f/fd/PaeoniaSuffruticosa7.jpg/320px-PaeoniaSuffruticosa7.jpg";
private static final String IMAGE_URL_1280 = "https://upload.wikimedia.org/wikipedia/commons/thumb/f/fd/PaeoniaSuffruticosa7.jpg/1280px-PaeoniaSuffruticosa7.jpg";
private static final String IMAGE_URL_WITH_NUMERIC_NAME_320 = "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b3/Paeonia_californica_2320679478.jpg/320px-Paeonia_californica_2320679478.jpg";
private static final String IMAGE_URL_WITH_NUMERIC_NAME_1280 = "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b3/Paeonia_californica_2320679478.jpg/1280px-Paeonia_californica_2320679478.jpg";
@Test
public void testUrlForSizeURI() {
Uri uri = Uri.parse(IMAGE_URL_320);
assertThat(ImageUrlUtil.getUrlForSize(uri, IMAGE_SIZE_1280).toString(), is(IMAGE_URL_320));
}
@Test
public void testUrlForSizeStringWithLargeSize() {
assertThat(ImageUrlUtil.getUrlForSize(IMAGE_URL_320, IMAGE_SIZE_1280), is(IMAGE_URL_320));
}
@Test
public void testUrlForSizeStringWithSmallSize() {
assertThat(ImageUrlUtil.getUrlForSize(IMAGE_URL_320, IMAGE_SIZE_200), is(IMAGE_URL_200));
}
@Test
public void testUrlForPreferredSizeWithRegularName() {
assertThat(ImageUrlUtil.getUrlForPreferredSize(IMAGE_URL_320, IMAGE_SIZE_1280), is(IMAGE_URL_1280));
}
@Test
public void testUrlForPreferredSizeWithNumericName() {
assertThat(ImageUrlUtil.getUrlForPreferredSize(IMAGE_URL_WITH_NUMERIC_NAME_320, IMAGE_SIZE_1280), is(IMAGE_URL_WITH_NUMERIC_NAME_1280));
}
}

View file

@ -0,0 +1,99 @@
package org.wikipedia.util;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import java.util.ArrayList;
import java.util.List;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
@RunWith(RobolectricTestRunner.class)
public class StringUtilTest {
@Test
@SuppressWarnings("checkstyle:magicnumber")
public void testGetBase26String() {
assertThat(StringUtil.getBase26String(1), is("A"));
assertThat(StringUtil.getBase26String(26), is("Z"));
assertThat(StringUtil.getBase26String(277), is("JQ"));
assertThat(StringUtil.getBase26String(2777), is("DBU"));
assertThat(StringUtil.getBase26String(27000), is("AMXL"));
assertThat(StringUtil.getBase26String(52), is("AZ"));
assertThat(StringUtil.getBase26String(53), is("BA"));
}
@Test
public void testListToCsv() {
List<String> stringList = new ArrayList<>();
stringList.add("one");
stringList.add("two");
assertThat(StringUtil.listToCsv(stringList), is("one,two"));
}
@Test
public void testCsvToList() {
List<String> stringList = new ArrayList<>();
stringList.add("one");
stringList.add("two");
assertThat(StringUtil.csvToList("one,two"), is(stringList));
}
@Test
public void testDelimiterStringToList() {
List<String> stringList = new ArrayList<>();
stringList.add("one");
stringList.add("two");
assertThat(StringUtil.delimiterStringToList("one,two", ","), is(stringList));
}
@Test
public void testMd5string() {
assertThat(StringUtil.md5string("test"), is("98f6bcd4621d373cade4e832627b4f6"));
}
@Test
public void testStrip() {
assertThat(StringUtil.strip("test"), is("test"));
assertThat(StringUtil.strip(" test "), is("test"));
}
@Test
public void testIntToHexStr() {
assertThat(StringUtil.intToHexStr(1), is("x00000001"));
}
@Test
public void testAddUnderscores() {
assertThat(StringUtil.addUnderscores("te st"), is("te_st"));
}
@Test
public void testRemoveUnderscores() {
assertThat(StringUtil.removeUnderscores("te_st"), is("te st"));
}
@Test
public void testHasSectionAnchor() {
assertThat(StringUtil.hasSectionAnchor("te_st"), is(false));
assertThat(StringUtil.hasSectionAnchor("#te_st"), is(true));
}
@Test
public void testRemoveSectionAnchor() {
assertThat(StringUtil.removeSectionAnchor("#te_st"), is(""));
assertThat(StringUtil.removeSectionAnchor("sec#te_st"), is("sec"));
}
@Test
public void testRemoveHTMLTags() {
assertThat(StringUtil.removeHTMLTags("<tag>te_st</tag>"), is("te_st"));
}
@Test
public void testSanitizeText() {
assertThat(StringUtil.sanitizeText(" [1] test"), is("test"));
assertThat(StringUtil.sanitizeText(" [1] (;test )"), is("(test )"));
}
}

View file

@ -0,0 +1,37 @@
package org.wikipedia.util;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
public class UriUtilTest {
/**
* Inspired by
* curl -s https://en.wikipedia.org/w/api.php?action=query&meta=siteinfo&format=json&siprop=general | jq .query.general.legaltitlechars
*/
private static final String TITLE
= " %!\"$&'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF+";
/**
* Inspired by
*from http://stackoverflow.com/questions/2849756/list-of-valid-characters-for-the-fragment-identifier-in-an-url
*/
private static final String LEGAL_FRAGMENT_CHARS
= "!$&'()*+,;=-._~:@/?abc0123456789%D8%f6";
@Test
public void testRemoveFragment() {
assertThat(UriUtil.removeFragment(TITLE + "#" + LEGAL_FRAGMENT_CHARS), is(TITLE));
}
@Test
public void testRemoveEmptyFragment() {
assertThat(UriUtil.removeFragment(TITLE + "#"), is(TITLE));
}
@Test
public void testRemoveFragmentWithHash() {
assertThat(UriUtil.removeFragment(TITLE + "##"), is(TITLE));
}
}

View file

@ -0,0 +1,161 @@
{
"announce": [
{
"id": "EN1116SURVEYIOS",
"type": "survey",
"start_time": "2016-11-15T17:11:12Z",
"end_time": "2016-11-30T17:11:12Z",
"platforms": [
"iOSApp"
],
"text": "Answer three questions and help us improve Wikipedia.",
"action": {
"title": "Take the survey",
"url": "https://survey.url?survey_id=12345&source=iOS"
},
"caption_HTML": "<p>Survey data handled by a third party. <a href=\"https://wikimediafoundation.org/wiki/Survey_Privacy_Statement\">Privacy</a>.</p>",
"countries": [
"US",
"CA",
"GB"
]
},
{
"id": "EN11116SURVEYANDROID",
"type": "survey",
"start_time": "2016-11-15T17:11:12Z",
"end_time": "2016-11-30T17:11:12Z",
"platforms": [
"AndroidAppV2"
],
"text": "Answer three questions and help us improve Wikipedia.",
"action": {
"title": "Take the survey",
"url": "https://survey.url?survey_id=12345&source=android"
},
"caption_HTML": "<p>Survey data handled by a third party. <a href=\"https://wikimediafoundation.org/wiki/Survey_Privacy_Statement\">Privacy</a>.</p>",
"countries": [
"US",
"CA",
"GB"
]
},
{
"id": "EN11116FUNDRAISINGANDROID",
"type": "fundraising",
"start_time": "2016-11-15T17:11:12Z",
"end_time": "2016-11-30T17:11:12Z",
"platforms": [
"AndroidAppV2"
],
"text": "Help Wikipedia by making a donation.",
"image_url" : "https://image.url",
"action": {
"title": "Donate",
"url": "https://donate.url?campaign_id=12345&source=android"
},
"caption_HTML": "By donating, you are agreeing to our <a href=\"https://wikimediafoundation.org/wiki/Special:LandingCheck?basic=true&landing_page=Donor_policy&country=%1$slanguage=%2$s&uselang=%2$s&utm_medium=androidapp\">donor privacy policy</a>.",
"countries": [
"US",
"CA",
"GB"
]
},
{
"id": "AnnouncementWithInvalidDates",
"type": "fundraising",
"start_time": null,
"end_time": null,
"platforms": [
"AndroidAppV2"
],
"text": "Help Wikipedia by making a donation.",
"action": {
"title": "Donate",
"url": "https://donate.url?campaign_id=12345&source=android"
},
"countries": [
"US",
"CA",
"GB"
]
},
{
"id": "AnnouncementWithNoDates",
"type": "fundraising",
"platforms": [
"AndroidAppV2"
],
"text": "Help Wikipedia by making a donation.",
"action": {
"title": "Donate",
"url": "https://donate.url?campaign_id=12345&source=android"
},
"countries": [
"US",
"CA",
"GB"
]
},
{
"id": "AnnouncementWithNoCountries",
"type": "fundraising",
"start_time": "2016-11-15T17:11:12Z",
"end_time": "2016-11-30T17:11:12Z",
"platforms": [
"AndroidAppV2"
],
"text": "Help Wikipedia by making a donation.",
"action": {
"title": "Donate",
"url": "https://donate.url?campaign_id=12345&source=android"
}
},
{
"id": "AnnouncementForBetaWithVersions",
"type": "fundraising",
"start_time": "2016-11-15T17:11:12Z",
"end_time": "2016-11-30T17:11:12Z",
"platforms": [
"AndroidAppV2"
],
"text": "Help Wikipedia by making a donation.",
"image_url" : "https://image.url",
"action": {
"title": "Donate",
"url": "https://donate.url?campaign_id=12345&source=android"
},
"caption_HTML": "By donating, you are agreeing to our <a href=\"https://wikimediafoundation.org/wiki/Special:LandingCheck?basic=true&landing_page=Donor_policy&country=%1$slanguage=%2$s&uselang=%2$s&utm_medium=androidapp\">donor privacy policy</a>.",
"countries": [
"US",
"CA",
"GB"
],
"beta": true,
"min_version": 200,
"max_version": 10000
},
{
"id": "AnnouncementForOldVersion",
"type": "fundraising",
"start_time": "2016-11-15T17:11:12Z",
"end_time": "2016-11-30T17:11:12Z",
"platforms": [
"AndroidAppV2"
],
"text": "Help Wikipedia by making a donation.",
"image_url" : "https://image.url",
"action": {
"title": "Donate",
"url": "https://donate.url?campaign_id=12345&source=android"
},
"caption_HTML": "By donating, you are agreeing to our <a href=\"https://wikimediafoundation.org/wiki/Special:LandingCheck?basic=true&landing_page=Donor_policy&country=%1$slanguage=%2$s&uselang=%2$s&utm_medium=androidapp\">donor privacy policy</a>.",
"countries": [
"US",
"CA",
"GB"
],
"max_version": 200
}
]
}

View file

@ -0,0 +1,10 @@
{
"errors": [
{
"code": "unknown_action",
"text": "Unrecognized value for parameter \"action\": oscillate."
}
],
"docref": "See https://en.wikipedia.org/w/api.php for API usage.",
"servedby": "mw1286"
}

View file

@ -0,0 +1,10 @@
{
"errors": [
{
"code": "assertuserfailed",
"text": "Assertion that the user is logged in failed."
}
],
"docref": "See https://en.wikipedia.org/w/api.php for API usage.",
"servedby": "mw1225"
}

View file

@ -0,0 +1,5 @@
{
"fancycaptchareload": {
"index": "1572672319"
}
}

View file

@ -0,0 +1,6 @@
{
"createaccount": {
"status": "FAIL",
"message": "Username entered already in use.\nPlease choose a different name."
}
}

View file

@ -0,0 +1,132 @@
{
"batchcomplete": true,
"query": {
"authmanagerinfo": {
"canauthenticatenow": true,
"cancreateaccounts": true,
"canlinkaccounts": false,
"haspreservedstate": false,
"hasprimarypreservedstate": false,
"preservedusername": "",
"requests": [
{
"id": "CaptchaAuthenticationRequest",
"metadata": {
"type": "image",
"mime": "image/png"
},
"required": "required",
"provider": "CaptchaAuthenticationRequest",
"account": "CaptchaAuthenticationRequest",
"fields": {
"captchaId": {
"type": "hidden",
"value": "272460457",
"label": "CAPTCHA ID",
"help": "This value should be sent back unchanged.",
"optional": false,
"sensitive": false
},
"captchaInfo": {
"type": "null",
"value": "/w/index.php?title=Special:Captcha/image&wpCaptchaId=272460457",
"label": "To edit this page, please enter the words that appear below in the box ([[Special:Captcha/help|more info]]):",
"help": "Description of the CAPTCHA.",
"optional": false,
"sensitive": false
},
"captchaWord": {
"type": "string",
"label": "CAPTCHA",
"help": "Solution of the CAPTCHA.",
"optional": false,
"sensitive": false
}
}
},
{
"id": "MediaWiki\\Auth\\PasswordAuthenticationRequest",
"metadata": {},
"required": "primary-required",
"provider": "Password-based authentication",
"account": "",
"fields": {
"username": {
"type": "string",
"label": "Username",
"help": "Username for authentication.",
"optional": false,
"sensitive": false
},
"password": {
"type": "password",
"label": "Password",
"help": "Password for authentication.",
"optional": false,
"sensitive": true
},
"retype": {
"type": "password",
"label": "Retype password:",
"help": "Password again to confirm.",
"optional": false,
"sensitive": true
}
}
},
{
"id": "CampaignsAuthenticationRequest",
"metadata": {},
"required": "optional",
"provider": "CampaignsAuthenticationRequest",
"account": "CampaignsAuthenticationRequest",
"fields": {
"campaign": {
"type": "hidden",
"value": "",
"label": "Campaign",
"help": "Identifies the campaign leading to an account creation.",
"optional": true,
"sensitive": false
}
}
},
{
"id": "MediaWiki\\Auth\\UsernameAuthenticationRequest",
"metadata": {},
"required": "required",
"provider": "MediaWiki\\Auth\\UsernameAuthenticationRequest",
"account": "MediaWiki\\Auth\\UsernameAuthenticationRequest",
"fields": {
"username": {
"type": "string",
"label": "Username",
"help": "Username for authentication.",
"optional": false,
"sensitive": false
}
}
},
{
"id": "MediaWiki\\Auth\\UserDataAuthenticationRequest",
"metadata": {},
"required": "required",
"provider": "MediaWiki\\Auth\\UserDataAuthenticationRequest",
"account": "MediaWiki\\Auth\\UserDataAuthenticationRequest",
"fields": {
"email": {
"type": "string",
"label": "Email",
"help": "Email address",
"optional": true,
"sensitive": false
}
}
}
]
},
"tokens": {
"createaccounttoken": "5d78e6a823be0901eeae9f6486f752da59123760+\\"
}
}
}

View file

@ -0,0 +1,6 @@
{
"createaccount": {
"status": "PASS",
"username": "Farb0nucci"
}
}

View file

@ -0,0 +1,8 @@
{
"batchcomplete": true,
"query": {
"tokens": {
"csrftoken": "b6f7bd58c013ab30735cb19ecc0aa08258122cba+\\"
}
}
}

View file

@ -0,0 +1,14 @@
{
"entity": {
"descriptions": {
"en": {
"language": "en",
"value": "some new description"
}
},
"id": "Q123",
"type": "item",
"lastrevid": 987654321
},
"success": 1
}

View file

@ -0,0 +1,22 @@
{
"errors": [
{
"code": "failed-save",
"text": "This action has been automatically identified as harmful, and therefore disallowed.\nIf you believe your action was constructive, please inform an administrator of what you were trying to do.",
"data": {
"messages": [
{
"name": "abusefilter-disallowed",
"parameters": [
"global-123"
],
"html": "This action has been automatically identified as harmful, and therefore disallowed.\nIf you believe your action was constructive, please inform an administrator of what you were trying to do."
}
]
},
"module": "main"
}
],
"docref": "See https://www.wikidata.org/w/api.php for API usage",
"servedby": "mw1228"
}

View file

@ -0,0 +1,23 @@
{
"errors": [
{
"code": "failed-save",
"text": "'''Warning:''' This action has been automatically identified as harmful.\nUnconstructive edits will be quickly reverted,\nand egregious or repeated unconstructive editing will result in your account or IP address being blocked.\nIf you believe this action to be constructive, you may submit it again to confirm it.\nA brief description of the abuse rule which your action matched is: Possible vandalism by adding badwords or similar trolling words",
"data": {
"messages": [
{
"name": "abusefilter-warning",
"parameters": [
"Possible vandalism by adding badwords or similar trolling words",
11
],
"html": "<b>Warning:</b> This action has been automatically identified as harmful.\nUnconstructive edits will be quickly reverted,\nand egregious or repeated unconstructive editing will result in your account or IP address being blocked.\nIf you believe this action to be constructive, you may submit it again to confirm it.\nA brief description of the abuse rule which your action matched is: Possible vandalism by adding badwords or similar trolling words"
}
]
},
"module": "main"
}
],
"docref": "See https://www.wikidata.org/w/api.php for API usage",
"servedby": "mw1228"
}

View file

@ -0,0 +1,10 @@
{
"errors": [
{
"code": "unknown_site",
"text": "Unrecognized value for parameter 'site': testwiki"
}
],
"docref": "See https://www.wikidata.org/w/api.php for API usage",
"servedby": "mw1196"
}

View file

@ -0,0 +1,23 @@
{
"edit": {
"code": "abusefilter-disallowed",
"message": {
"key": "abusefilter-warning/userpage_edit",
"params": [
"Editing user page by anonymous user",
94
]
},
"abusefilter": {
"id": 94,
"description": "Editing user page by anonymous user",
"actions": [
"tag",
"warn"
]
},
"info": "Hit AbuseFilter: Editing user page by anonymous user",
"warning": "<b>Warning:</b> This action has been automatically identified as harmful.\nUnconstructive edits will be quickly reverted,\nand egregious or repeated unconstructive editing will result in your account or IP address being blocked.\nIf you believe this action to be constructive, you may submit it again to confirm it.\nA brief description of the abuse rule which your action matched is: Editing user page by anonymous user",
"result": "Failure"
}
}

View file

@ -0,0 +1,10 @@
{
"errors": [
{
"code": "badtoken",
"text": "Invalid token"
}
],
"docref": "See https://en.wikipedia.org/w/api.php for API usage",
"servedby": "mw1222"
}

View file

@ -0,0 +1,7 @@
{
"parse": {
"title": "User:Mhollo/sandbox",
"pageid": 46498401,
"text": "<div class=\"mf-section-0\" id=\"mf-section-0\"><p>\\o/\\n\\ntest12\\n\\n3</p>\n\n\n\n\n</div>"
}
}

View file

@ -0,0 +1,11 @@
{
"edit": {
"captcha": {
"type": "image",
"mime": "image/png",
"id": "547159230",
"url": "/w/index.php?title=Special:Captcha/image&wpCaptchaId=547159230"
},
"result": "Failure"
}
}

View file

@ -0,0 +1,6 @@
{
"edit": {
"spamblacklist": "s-e-x",
"result": "Failure"
}
}

View file

@ -0,0 +1,11 @@
{
"edit": {
"result": "Success",
"pageid": 46498401,
"title": "User:Mhollo/sandbox",
"contentmodel": "wikitext",
"oldrevid": 760523240,
"newrevid": 761350490,
"newtimestamp": "2017-01-22T13:43:39Z"
}
}

View file

@ -0,0 +1,10 @@
{
"errors": [
{
"code": "assertuserfailed",
"text": "Assertion that the user is logged in failed"
}
],
"docref": "See https://en.wikipedia.org/w/api.php for API usage",
"servedby": "mw1221"
}

View file

@ -0,0 +1,52 @@
{
"type": "standard",
"title": "From The Doctor to my son Thomas",
"displaytitle": "From The Doctor to my son Thomas",
"namespace": {
"id": 0,
"text": ""
},
"titles": {
"canonical": "From_The_Doctor_to_my_son_Thomas",
"normalized": "From The Doctor to my son Thomas",
"display": "From The Doctor to my son Thomas"
},
"pageid": 44359985,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/en/thumb/b/b0/From_The_Doctor_to_my_son_Thomas.jpg/320px-From_The_Doctor_to_my_son_Thomas.jpg",
"width": 320,
"height": 180
},
"originalimage": {
"source": "https://upload.wikimedia.org/wikipedia/en/b/b0/From_The_Doctor_to_my_son_Thomas.jpg",
"width": 421,
"height": 237
},
"lang": "en",
"dir": "ltr",
"revision": "834131708",
"tid": "2f3a3ca2-37b4-11e8-872f-6606414e07f0",
"timestamp": "2018-04-04T02:59:21Z",
"description": "viral video recorded by actor Peter Capaldi",
"extract": "\"From The Doctor to my son Thomas\" is a viral video recorded by actor Peter Capaldi and sent to Thomas Goodall, an autistic nine-year-old boy in England, to console the child over grief from the death of Goodall's grandmother. Capaldi filmed the 42-second video in character as the 12th incarnation of The Doctor in the BBC science-fiction series Doctor Who. Capaldi's message had a positive effect on Thomas; his father said that the boy smiled for the first time since learning of his grandmother's death, and gained the courage to go to her funeral.",
"extract_html": "<p>&quot;<b>From The Doctor to my son Thomas</b>&quot; is a viral video recorded by actor Peter Capaldi and sent to Thomas Goodall, an autistic nine-year-old boy in England, to console the child over grief from the death of Goodall's grandmother. Capaldi filmed the 42-second video in character as the 12th incarnation of The Doctor in the BBC science-fiction series <i>Doctor Who</i>. Capaldi's message had a positive effect on Thomas; his father said that the boy smiled for the first time since learning of his grandmother's death, and gained the courage to go to her funeral.</p>",
"content_urls": {
"desktop": {
"page": "https://en.wikipedia.org/wiki/From_The_Doctor_to_my_son_Thomas",
"revisions": "https://en.wikipedia.org/wiki/From_The_Doctor_to_my_son_Thomas?action=history",
"edit": "https://en.wikipedia.org/wiki/From_The_Doctor_to_my_son_Thomas?action=edit",
"talk": "https://en.wikipedia.org/wiki/Talk:From_The_Doctor_to_my_son_Thomas"
},
"mobile": {
"page": "https://en.m.wikipedia.org/wiki/From_The_Doctor_to_my_son_Thomas",
"revisions": "https://en.m.wikipedia.org/wiki/Special:History/From_The_Doctor_to_my_son_Thomas",
"edit": "https://en.m.wikipedia.org/wiki/From_The_Doctor_to_my_son_Thomas?action=edit",
"talk": "https://en.m.wikipedia.org/wiki/Talk:From_The_Doctor_to_my_son_Thomas"
}
},
"api_urls": {
"summary": "https://en.wikipedia.org/api/rest_v1/page/summary/From_The_Doctor_to_my_son_Thomas",
"edit_html": "https://en.wikipedia.org/api/rest_v1/page/html/From_The_Doctor_to_my_son_Thomas",
"talk_page_html": "https://en.wikipedia.org/api/rest_v1/page/html/Talk:From_The_Doctor_to_my_son_Thomas"
}
}

View file

@ -0,0 +1,277 @@
{
"batchcomplete": true,
"continue": {
"gsroffset": 20,
"continue": "gsroffset||"
},
"query": {
"pages": [
{
"pageid": 45579,
"ns": 0,
"title": "Queens",
"index": 3,
"terms": {
"description": [
"borough of New York City, New York, United States",
"borough of New York City, New York, United States"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Queens_Montage_2012_1.png/285px-Queens_Montage_2012_1.png",
"width": 285,
"height": 320
}
},
{
"pageid": 413863,
"ns": 0,
"title": "A (New York City Subway service)",
"index": 10,
"terms": {
"description": [
"New York City Subway service"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/95/Northbound_R46_A_train_at_88_St.jpg/320px-Northbound_R46_A_train_at_88_St.jpg",
"width": 320,
"height": 239
}
},
{
"pageid": 426995,
"ns": 0,
"title": "E (New York City Subway service)",
"index": 7,
"terms": {
"description": [
"New York City Subway service"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/1c/R160_E_Train_at_Jamaica_Center.jpg/320px-R160_E_Train_at_Jamaica_Center.jpg",
"width": 320,
"height": 213
}
},
{
"pageid": 455504,
"ns": 0,
"title": "Independent Subway System",
"index": 12,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c7/BMT_100_Nostalgia_Ride_%2819329819685%29.jpg/320px-BMT_100_Nostalgia_Ride_%2819329819685%29.jpg",
"width": 320,
"height": 214
}
},
{
"pageid": 587752,
"ns": 0,
"title": "Briarwood, Queens",
"index": 6,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/8a/Normal_Rd_160_St_Briarwood_jeh.jpg/320px-Normal_Rd_160_St_Briarwood_jeh.jpg",
"width": 320,
"height": 256
}
},
{
"pageid": 1256263,
"ns": 0,
"title": "Queens Boulevard",
"index": 2
},
{
"pageid": 1440202,
"ns": 0,
"title": "New York City Subway nomenclature",
"index": 14,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a0/InsideStation.JPG/320px-InsideStation.JPG",
"width": 320,
"height": 241
}
},
{
"pageid": 1458237,
"ns": 0,
"title": "IND Queens Boulevard Line",
"index": 1
},
{
"pageid": 1493748,
"ns": 0,
"title": "IND Crosstown Line",
"index": 9,
"terms": {
"description": [
"railway line"
]
}
},
{
"pageid": 1495545,
"ns": 0,
"title": "63rd Street Lines",
"index": 17,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/5/56/NYCS-line-trans-63rd.svg/320px-NYCS-line-trans-63rd.svg.png",
"width": 320,
"height": 170
}
},
{
"pageid": 1510026,
"ns": 0,
"title": "F (New York City Subway service)",
"index": 19,
"terms": {
"description": [
"New York City Subway service"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/MTA_NYC_Subway_F_train_arriving_at_Avenue_P.JPG/320px-MTA_NYC_Subway_F_train_arriving_at_Avenue_P.JPG",
"width": 320,
"height": 240
}
},
{
"pageid": 1619462,
"ns": 0,
"title": "Springfield Gardens, Queens",
"index": 15,
"terms": {
"description": [
"neighborhood"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/69/NYTel_140_Av_183_St_jeh.JPG/320px-NYTel_140_Av_183_St_jeh.JPG",
"width": 320,
"height": 278
}
},
{
"pageid": 2243580,
"ns": 0,
"title": "Forest Hills71st Avenue (IND Queens Boulevard Line)",
"index": 5,
"terms": {
"description": [
"New York City IND Queens Boulevard Line subway station"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3b/Forest_Hills_-_Manhattan_Bound_Platform.jpg/320px-Forest_Hills_-_Manhattan_Bound_Platform.jpg",
"width": 320,
"height": 240
}
},
{
"pageid": 4573843,
"ns": 0,
"title": "Kew GardensUnion Turnpike (IND Queens Boulevard Line)",
"index": 4,
"terms": {
"description": [
"New York City IND Queens Boulevard Line subway station"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/04/Kew_Gardens_-_Jamaica_Bound_Platform.jpg/320px-Kew_Gardens_-_Jamaica_Bound_Platform.jpg",
"width": 320,
"height": 240
}
},
{
"pageid": 5641637,
"ns": 0,
"title": "Jackson HeightsRoosevelt Avenue/74th Street (New York City Subway)",
"index": 20,
"terms": {
"description": [
"New York City subway station"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Jackson_Heights-Roosevelt_Avenue_Terminal.JPG/320px-Jackson_Heights-Roosevelt_Avenue_Terminal.JPG",
"width": 320,
"height": 240
}
},
{
"pageid": 5751551,
"ns": 0,
"title": "67th Avenue (IND Queens Boulevard Line)",
"index": 16,
"terms": {
"description": [
"New York City IND Queens Boulevard Line subway station"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/be/67th_Avenue_-_Manhattan_Bound_Platform.jpg/320px-67th_Avenue_-_Manhattan_Bound_Platform.jpg",
"width": 320,
"height": 240
}
},
{
"pageid": 5751848,
"ns": 0,
"title": "Woodhaven Boulevard (IND Queens Boulevard Line)",
"index": 8,
"terms": {
"description": [
"New York City IND Queens Boulevard Line subway station"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a9/Woodhaven_Boulevard_-_Forest_Hills_Bound_Platform.jpg/320px-Woodhaven_Boulevard_-_Forest_Hills_Bound_Platform.jpg",
"width": 320,
"height": 240
}
},
{
"pageid": 6757992,
"ns": 0,
"title": "Woodhaven and Cross Bay Boulevards",
"index": 11,
"terms": {
"description": [
"highway in New York"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/68/Woodhaven_Boulevard.jpg/320px-Woodhaven_Boulevard.jpg",
"width": 320,
"height": 240
}
},
{
"pageid": 7929179,
"ns": 0,
"title": "Union Turnpike (New York)",
"index": 18
},
{
"pageid": 24884614,
"ns": 0,
"title": "List of New York City Subway stations in Queens",
"index": 13,
"terms": {
"description": [
"Wikimedia list article"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/04/NYC_subway-4D.svg/296px-NYC_subway-4D.svg.png",
"width": 296,
"height": 320
}
}
]
}
}

View file

@ -0,0 +1,8 @@
{
"batchcomplete": true,
"warnings": {
"search": {
"warnings": "No valid titles provided to 'morelike'."
}
}
}

View file

@ -0,0 +1,211 @@
{
"revision": "854945118",
"tid": "048d1a3a-a007-11e8-a249-b9bc3181aba8",
"items": [{
"section_id": 0,
"type": "image",
"showInGallery": true,
"titles": {
"canonical": "File:Flag_of_the_United_States.svg",
"normalized": "File:Flag of the United States.svg",
"display": "File:Flag of the United States.svg"
},
"thumbnail": {
"source": "http://upload.wikimedia.org/wikipedia/en/thumb/a/a4/Flag_of_the_United_States.svg/320px-Flag_of_the_United_States.svg.png",
"width": 320,
"height": 168,
"mime": "image/png"
},
"original": {
"source": "http://upload.wikimedia.org/wikipedia/en/a/a4/Flag_of_the_United_States.svg",
"mime": "image/svg+xml"
},
"file_page": "http://en.wikipedia.org/wiki/File:Flag_of_the_United_States.svg",
"license": {
"type": "PD",
"code": "pd"
}
}, {
"section_id": 1,
"type": "image",
"showInGallery": true,
"titles": {
"canonical": "File:Great_Seal_of_the_United_States_(obverse).svg",
"normalized": "File:Great Seal of the United States (obverse).svg",
"display": "File:Great Seal of the United States (obverse).svg"
},
"thumbnail": {
"source": "http://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Great_Seal_of_the_United_States_%28obverse%29.svg/320px-Great_Seal_of_the_United_States_%28obverse%29.svg.png",
"width": 320,
"height": 320,
"mime": "image/png"
},
"original": {
"source": "http://upload.wikimedia.org/wikipedia/commons/5/5c/Great_Seal_of_the_United_States_%28obverse%29.svg",
"mime": "image/svg+xml"
},
"file_page": "https://commons.wikimedia.org/wiki/File:Great_Seal_of_the_United_States_(obverse).svg",
"artist": {
"html": "U.S. Government",
"name": "U.S. Government"
},
"credit": "Extracted from PDF version of <i>Our Flag</i>, available <a rel=\"nofollow\" class=\"external text\" href=\"http://www.senate.gov/reference/reference_index_subjects/Flags_vrd.htm\">here</a> (direct PDF URL <a rel=\"nofollow\" class=\"external text\" href=\"http://www.senate.gov/reference/resources/pdf/ourflag.pdf\">here</a>.)",
"license": {
"type": "Public domain",
"code": "pd"
},
"description": {
"html": "Obverse of the <a href=\"https://en.wikipedia.org/wiki/Great_Seal_of_the_United_States\" class=\"extiw\" title=\"en:Great Seal of the United States\">Great Seal of the United States</a>.",
"text": "Obverse of the Great Seal of the United States.",
"lang": "en"
}
}, {
"section_id": 2,
"type": "audio",
"audio_type": "generic",
"showInGallery": true,
"titles": {
"canonical": "File:Star_Spangled_Banner_instrumental.ogg",
"normalized": "File:Star Spangled Banner instrumental.ogg",
"display": "File:Star Spangled Banner instrumental.ogg"
},
"thumbnail": {
"source": "http://en.wikipedia.org/w/resources/assets/file-type-icons/fileicon-ogg.png",
"width": 320,
"height": 320,
"mime": "image/jpeg"
},
"original": {
"source": "http://upload.wikimedia.org/wikipedia/commons/6/65/Star_Spangled_Banner_instrumental.ogg",
"mime": "application/ogg"
},
"file_page": "https://commons.wikimedia.org/wiki/File:Star_Spangled_Banner_instrumental.ogg",
"duration": 78.262857142857,
"credit": "<p><a rel=\"nofollow\" class=\"external free\" href=\"https://web.archive.org/web/20041019005037/http://www.navyband.navy.mil/anthems/ANTHEMS/United%20States.mp3\">https://web.archive.org/web/20041019005037/http://www.navyband.navy.mil/anthems/ANTHEMS/United%20States.mp3</a>\n</p>\n<ul>\n<li><a rel=\"nofollow\" class=\"external free\" href=\"https://web.archive.org/web/20030506222549/http://www.navyband.navy.mil:80/anthems/Honors%20Music/Honors/Four%20Ruffles%20and%20Flourishes%20and%20the%20National%20Anthem.MP3\">https://web.archive.org/web/20030506222549/http://www.navyband.navy.mil:80/anthems/Honors%20Music/Honors/Four%20Ruffles%20and%20Flourishes%20and%20the%20National%20Anthem.MP3</a></li>\n<li><a rel=\"nofollow\" class=\"external free\" href=\"https://web.archive.org/web/20030827205544/http://www.navyband.navy.mil:80/anthems/Honors%20Music/Parade%20the%20Colors/Star%20Spangled%20Banner.MP3\">https://web.archive.org/web/20030827205544/http://www.navyband.navy.mil:80/anthems/Honors%20Music/Parade%20the%20Colors/Star%20Spangled%20Banner.MP3</a></li>\n</ul>",
"license": {
"type": "Public domain",
"code": "pd"
},
"description": {
"html": "The <a href=\"https://en.wikipedia.org/wiki/national_anthem\" class=\"extiw\" title=\"en:national anthem\">national anthem</a> of the <a href=\"https://en.wikipedia.org/wiki/United_States\" class=\"extiw\" title=\"en:United States\">United States of America</a>, originally, music of <a href=\"https://en.wikipedia.org/wiki/The_Anacreontic_Song\" class=\"extiw\" title=\"en:The Anacreontic Song\">The Anacreontic Song</a>, performed by the U.S. Navy Band.",
"text": "The national anthem of the United States of America, originally, music of The Anacreontic Song, performed by the U.S. Navy Band.",
"lang": "en"
}
}, {
"section_id": 3,
"type": "audio",
"audio_type": "generic",
"showInGallery": true,
"titles": {
"canonical": "File:March,_Colonel_John_R._Bourgeois,_Director_·_John_Philip_Sousa_·_United_States_Marine_Band.ogg",
"normalized": "File:March, \"The Stars and Stripes Forever\" · Colonel John R. Bourgeois, Director · John Philip Sousa · United States Marine Band.ogg",
"display": "File:March, \"The Stars and Stripes Forever\" · Colonel John R. Bourgeois, Director · John Philip Sousa · United States Marine Band.ogg"
},
"thumbnail": {
"source": "http://en.wikipedia.org/w/resources/assets/file-type-icons/fileicon-ogg.png",
"width": 320,
"height": 320,
"mime": "image/jpeg"
},
"original": {
"source": "http://upload.wikimedia.org/wikipedia/commons/7/7e/March%2C_%22The_Stars_and_Stripes_Forever%22_%C2%B7_Colonel_John_R._Bourgeois%2C_Director_%C2%B7_John_Philip_Sousa_%C2%B7_United_States_Marine_Band.ogg",
"mime": "application/ogg"
},
"file_page": "https://commons.wikimedia.org/wiki/File:March,_%22The_Stars_and_Stripes_Forever%22_%C2%B7_Colonel_John_R._Bourgeois,_Director_%C2%B7_John_Philip_Sousa_%C2%B7_United_States_Marine_Band.ogg",
"duration": 226.51766666667,
"credit": "Album: \"On Tour\"",
"license": {
"type": "Public domain",
"code": "pd"
},
"description": {
"html": "John Philip Sousa's march \"<a href=\"https://en.wikipedia.org/wiki/The_Stars_and_Stripes_Forever\" class=\"extiw\" title=\"en:The Stars and Stripes Forever\">The Stars and Stripes Forever</a>\", performed by the U.S. Marine Band.",
"text": "John Philip Sousa's march \"The Stars and Stripes Forever\", performed by the U.S. Marine Band.",
"lang": "en"
}
}, {
"section_id": 4,
"type": "video",
"caption": {
"html": "In a video, team members share the challenges of <a rel=\"mw:WikiLink\" href=\"./Mars_Science_Laboratory\" title=\"Mars Science Laboratory\" id=\"mwEw\">Mars Science Laboratory</a>'s (<a rel=\"mw:WikiLink\" href=\"./Curiosity_(rover)\" title=\"Curiosity (rover)\" id=\"mwFA\"><i id=\"mwFQ\">Curiosity</i></a>) final minutes to landing on the surface of <a rel=\"mw:WikiLink\" href=\"./Mars\" title=\"Mars\" id=\"mwFg\">Mars</a>.",
"text": "In a video, team members share the challenges of Mars Science Laboratory's (Curiosity) final minutes to landing on the surface of Mars."
},
"sources": [{
"url": "https://upload.wikimedia.org/wikipedia/commons/9/96/Curiosity%27s_Seven_Minutes_of_Terror.ogv",
"mime": "video/ogg",
"codecs": ["theora", "vorbis"],
"name": "Original Ogg file, 1,280 × 720 (2.39 Mbps)",
"short_name": "Ogg source",
"width": "1280",
"height": "720"
}, {
"url": "https://upload.wikimedia.org/wikipedia/commons/transcoded/9/96/Curiosity%27s_Seven_Minutes_of_Terror.ogv/Curiosity%27s_Seven_Minutes_of_Terror.ogv.160p.webm",
"mime": "video/webm",
"codecs": ["vp8", "vorbis"],
"name": "Low bandwidth WebM (160P)",
"short_name": "WebM 160P",
"width": "284",
"height": "160"
}, {
"url": "https://upload.wikimedia.org/wikipedia/commons/transcoded/9/96/Curiosity%27s_Seven_Minutes_of_Terror.ogv/Curiosity%27s_Seven_Minutes_of_Terror.ogv.240p.webm",
"mime": "video/webm",
"codecs": ["vp8", "vorbis"],
"name": "Small WebM (240P)",
"short_name": "WebM 240P",
"width": "426",
"height": "240"
}, {
"url": "https://upload.wikimedia.org/wikipedia/commons/transcoded/9/96/Curiosity%27s_Seven_Minutes_of_Terror.ogv/Curiosity%27s_Seven_Minutes_of_Terror.ogv.360p.webm",
"mime": "video/webm",
"codecs": ["vp8", "vorbis"],
"name": "WebM (360P)",
"short_name": "WebM 360P",
"width": "640",
"height": "360"
}, {
"url": "https://upload.wikimedia.org/wikipedia/commons/transcoded/9/96/Curiosity%27s_Seven_Minutes_of_Terror.ogv/Curiosity%27s_Seven_Minutes_of_Terror.ogv.480p.webm",
"mime": "video/webm",
"codecs": ["vp8", "vorbis"],
"name": "SD WebM (480P)",
"short_name": "WebM 480P",
"width": "854",
"height": "480"
}, {
"url": "https://upload.wikimedia.org/wikipedia/commons/transcoded/9/96/Curiosity%27s_Seven_Minutes_of_Terror.ogv/Curiosity%27s_Seven_Minutes_of_Terror.ogv.720p.webm",
"mime": "video/webm",
"codecs": ["vp8", "vorbis"],
"name": "HD WebM (720P)",
"short_name": "WebM 720P",
"width": "1280",
"height": "720"
}],
"showInGallery": true,
"titles": {
"canonical": "File:Curiosity's_Seven_Minutes_of_Terror.ogv",
"normalized": "File:Curiosity's Seven Minutes of Terror.ogv",
"display": "File:Curiosity's Seven Minutes of Terror.ogv"
},
"thumbnail": {
"source": "http://upload.wikimedia.org/wikipedia/commons/thumb/9/96/Curiosity%27s_Seven_Minutes_of_Terror.ogv/320px--Curiosity%27s_Seven_Minutes_of_Terror.ogv.jpg",
"width": 320,
"height": 180,
"mime": "image/jpeg"
},
"file_page": "https://commons.wikimedia.org/wiki/File:Curiosity%27s_Seven_Minutes_of_Terror.ogv",
"duration": 306.47283333333,
"artist": {
"html": "NASA",
"name": "NASA"
},
"credit": "<a rel=\"nofollow\" class=\"external free\" href=\"http://www.jpl.nasa.gov/video/details.php?id=1090\">http://www.jpl.nasa.gov/video/details.php?id=1090</a>",
"license": {
"type": "Public domain",
"code": "pd"
},
"description": {
"html": "Team members share the challenges of <a href=\"https://en.wikipedia.org/wiki/Mars_Science_Laboratory\" class=\"extiw\" title=\"w:Mars Science Laboratory\">Mars Science Laboratory</a>'s (<a href=\"https://en.wikipedia.org/wiki/Curiosity_(rover)\" class=\"extiw\" title=\"en:Curiosity (rover)\">Curiosity</a>) final minutes to landing on the surface of Mars.",
"text": "Team members share the challenges of Mars Science Laboratory's (Curiosity) final minutes to landing on the surface of Mars.",
"lang": "en"
}
}]
}

View file

@ -0,0 +1,109 @@
{
"batchcomplete": true,
"query": {
"normalized": [
{
"fromencoded": false,
"from": "File:Mark_Selby_at_Snooker_German_Masters_(DerHexer)_2015-02-04_02.jpg",
"to": "File:Mark Selby at Snooker German Masters (DerHexer) 2015-02-04 02.jpg"
}
],
"pages": [
{
"ns": 6,
"title": "File:Mark Selby at Snooker German Masters (DerHexer) 2015-02-04 02.jpg",
"missing": true,
"known": true,
"imagerepository": "shared",
"imageinfo": [
{
"extmetadata": {
"DateTime": {
"value": "2015-02-11 20:27:39",
"source": "mediawiki-metadata",
"hidden": ""
},
"ObjectName": {
"value": "Mark Selby at Snooker German Masters (DerHexer) 2015-02-04 02",
"source": "mediawiki-metadata",
"hidden": ""
},
"CommonsMetadataExtension": {
"value": 1.2,
"source": "extension",
"hidden": ""
},
"Categories": {
"value": "Files by DerHexer|German Masters 2015-Day 1, Session 2|Images with extracted images|Mark Selby|Personality rights warning|Self-published work|Uploaded with VicuñaUploader",
"source": "commons-categories",
"hidden": ""
},
"Assessments": {
"value": "",
"source": "commons-categories",
"hidden": ""
},
"ImageDescription": {
"value": "Picture taken in Berlin during the <a href=\"https://en.wikipedia.org/wiki/2015_German_Masters\" class=\"extiw\" title=\"en:2015 German Masters\">Snooker German Masters in 2015</a>. Mark Selby.",
"source": "commons-desc-page"
},
"DateTimeOriginal": {
"value": "2015-02-04 15:19",
"source": "commons-desc-page"
},
"Credit": {
"value": "<span class=\"int-own-work\" lang=\"en\">Own work</span>",
"source": "commons-desc-page",
"hidden": ""
},
"Artist": {
"value": "<a href=\"//commons.wikimedia.org/wiki/User:DerHexer\" title=\"User:DerHexer\">DerHexer</a>",
"source": "commons-desc-page"
},
"LicenseShortName": {
"value": "CC BY-SA 4.0",
"source": "commons-desc-page",
"hidden": ""
},
"UsageTerms": {
"value": "Creative Commons Attribution-Share Alike 4.0",
"source": "commons-desc-page",
"hidden": ""
},
"AttributionRequired": {
"value": "true",
"source": "commons-desc-page",
"hidden": ""
},
"Attribution": {
"value": "DerHexer, Wikimedia Commons, CC-by-sa 4.0",
"source": "commons-desc-page",
"hidden": ""
},
"LicenseUrl": {
"value": "http://creativecommons.org/licenses/by-sa/4.0",
"source": "commons-desc-page",
"hidden": ""
},
"Copyrighted": {
"value": "True",
"source": "commons-desc-page",
"hidden": ""
},
"Restrictions": {
"value": "personality",
"source": "commons-desc-page",
"hidden": ""
},
"License": {
"value": "cc-by-sa-4.0",
"source": "commons-templates",
"hidden": ""
}
}
}
]
}
]
}
}

View file

@ -0,0 +1,26 @@
{
"batchcomplete": "",
"query": {
"pages": [
{
"pageid": 13118744,
"ns": 0,
"title": "Scientology",
"langlinks": [
{
"lang": "af",
"title": "Sciëntologie"
},
{
"lang": "ar",
"title": "سينتولوجيا"
},
{
"lang": "arz",
"title": "سيينتولوجيا"
}
]
}
]
}
}

View file

@ -0,0 +1,19 @@
{
"batchcomplete": "",
"query": {
"normalized": [
{
"fromencoded": false,
"from": "Hot_Molasses",
"to": "Hot Molasses"
}
],
"pages": [
{
"pageid": 47002725,
"ns": 0,
"title": "Hot Molasses"
}
]
}
}

View file

@ -0,0 +1,447 @@
{
"date": "2016-06-01Z",
"articles": [
{
"views": 330200,
"rank": 3,
"title": "Bicycle_Race",
"pageid": 3957496,
"normalizedtitle": "Bicycle Race",
"description": "rock song by Queen"
},
{
"views": 265986,
"rank": 5,
"title": "Dare_to_Be_Stupid_(song)",
"pageid": 4082868,
"normalizedtitle": "Dare to Be Stupid (song)",
"description": "1985 \"Weird Al\" Yankovic song"
},
{
"views": 258829,
"rank": 6,
"title": "Razak_Khan",
"pageid": 40626711,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Razak_Khan.jpg/241px-Razak_Khan.jpg",
"width": 241,
"height": 320
},
"normalizedtitle": "Razak Khan",
"description": "Indian actor"
},
{
"views": 201439,
"rank": 8,
"title": "Marilyn_Monroe",
"pageid": 19318,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0a/Marilyn_Monroe_in_1952.jpg/229px-Marilyn_Monroe_in_1952.jpg",
"width": 229,
"height": 320
},
"normalizedtitle": "Marilyn Monroe",
"description": "American actress, model, and singer"
},
{
"views": 184527,
"rank": 9,
"title": "Het_Klokhuis",
"pageid": 3118503,
"normalizedtitle": "Het Klokhuis",
"description": "Dutch educational show"
},
{
"views": 176512,
"rank": 10,
"title": "Big_Trouble_(2002_film)",
"pageid": 1703740,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/en/thumb/b/b5/Big_trouble_ver2.jpg/217px-Big_trouble_ver2.jpg",
"width": 217,
"height": 320
},
"normalizedtitle": "Big Trouble (2002 film)",
"description": "2002 American comedy film"
},
{
"views": 136099,
"rank": 11,
"title": "X-Men:_Apocalypse",
"pageid": 43530847,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/98/Englefield_House_-_geograph.org.uk_-_1824880.jpg/320px-Englefield_House_-_geograph.org.uk_-_1824880.jpg",
"width": 320,
"height": 213
},
"normalizedtitle": "X-Men: Apocalypse",
"description": "2016 superhero film"
},
{
"views": 125269,
"rank": 12,
"title": "Gotthard_Base_Tunnel",
"pageid": 692624,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5d/20141120_gotthard-basistunnel02-wikipedia-hannes-ortlieb.jpg/320px-20141120_gotthard-basistunnel02-wikipedia-hannes-ortlieb.jpg",
"width": 320,
"height": 213
},
"normalizedtitle": "Gotthard Base Tunnel",
"description": "railway tunnel through the Swiss Alps"
},
{
"views": 116784,
"rank": 14,
"title": "UEFA_Euro_2016",
"pageid": 7932564,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/en/thumb/f/f1/UEFA_Euro_2016_Logo.svg/227px-UEFA_Euro_2016_Logo.svg.png",
"width": 227,
"height": 320
},
"normalizedtitle": "UEFA Euro 2016",
"description": "football tournament held in 2016"
},
{
"views": 98366,
"rank": 15,
"title": "Kunta_Kinte",
"pageid": 951527,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/9e/IJzeren_voetring_voor_gevangenen_transparent_background.png/320px-IJzeren_voetring_voor_gevangenen_transparent_background.png",
"width": 320,
"height": 175
},
"normalizedtitle": "Kunta Kinte",
"description": "From Alex Haley's ''Roots''"
},
{
"views": 96331,
"rank": 16,
"title": "98.6_(disambiguation)",
"pageid": 12124572,
"normalizedtitle": "98.6 (disambiguation)",
"description": "Wikipedia disambiguation page"
},
{
"views": 92076,
"rank": 17,
"title": "Deaths_in_2016",
"pageid": 48857868,
"normalizedtitle": "Deaths in 2016",
"description": "Wikimedia list article"
},
{
"views": 88800,
"rank": 18,
"title": "Amber_Heard",
"pageid": 10784468,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/01/Amber_Heard_2011.jpg/231px-Amber_Heard_2011.jpg",
"width": 231,
"height": 320
},
"normalizedtitle": "Amber Heard",
"description": "American actress"
},
{
"views": 86325,
"rank": 19,
"title": "Game_of_Thrones_(season_6)",
"pageid": 43186937,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/Castillo_de_Zafra_-_Exterior.JPG/320px-Castillo_de_Zafra_-_Exterior.JPG",
"width": 320,
"height": 180
},
"normalizedtitle": "Game of Thrones (season 6)",
"description": "sixth season of the fantasy drama television series Game of Thrones"
},
{
"views": 77042,
"rank": 20,
"title": "Roots_(2016_miniseries)",
"pageid": 49403994,
"normalizedtitle": "Roots (2016 miniseries)",
"description": "2016 miniseries"
},
{
"views": 75046,
"rank": 21,
"title": "Game_of_Thrones",
"pageid": 20715044,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Game_of_Thrones_Oslo_exhibition_2014_-_Weapons.jpg/320px-Game_of_Thrones_Oslo_exhibition_2014_-_Weapons.jpg",
"width": 320,
"height": 253
},
"normalizedtitle": "Game of Thrones",
"description": "American fantasy drama television series"
},
{
"views": 72363,
"rank": 23,
"title": "Roots_(miniseries)",
"pageid": 50676323,
"normalizedtitle": "Roots (miniseries)"
},
{
"views": 69446,
"rank": 24,
"title": "Captain_America:_Civil_War",
"pageid": 41974496,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/8e/Cast_of_Captain_America_Civil_War.jpg/320px-Cast_of_Captain_America_Civil_War.jpg",
"width": 320,
"height": 187
},
"normalizedtitle": "Captain America: Civil War",
"description": "2016 superhero film produced by Marvel Studios"
},
{
"views": 66186,
"rank": 25,
"title": "Dread_Pirate_Roberts",
"pageid": 592069,
"normalizedtitle": "Dread Pirate Roberts",
"description": "fictional pirate"
},
{
"views": 65737,
"rank": 26,
"title": "State_of_Origin_series",
"pageid": 1954843,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/en/thumb/e/e8/First_State_of_Origin_Shield.jpg/301px-First_State_of_Origin_Shield.jpg",
"width": 301,
"height": 320
},
"normalizedtitle": "State of Origin series"
},
{
"views": 65675,
"rank": 27,
"title": "Gorilla",
"pageid": 12546,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/Male_gorilla_in_SF_zoo.jpg/287px-Male_gorilla_in_SF_zoo.jpg",
"width": 287,
"height": 320
},
"normalizedtitle": "Gorilla",
"description": "genus of mammals"
},
{
"views": 62510,
"rank": 28,
"title": "Stephen_Curry",
"pageid": 5608488,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/3/36/Stephen_Curry_dribbling_2016_%28cropped%29.jpg/178px-Stephen_Curry_dribbling_2016_%28cropped%29.jpg",
"width": 178,
"height": 320
},
"normalizedtitle": "Stephen Curry",
"description": "American basketball player"
},
{
"views": 62441,
"rank": 29,
"title": "Maya_Rudolph",
"pageid": 511348,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Maya_Rudolph.jpg/318px-Maya_Rudolph.jpg",
"width": 318,
"height": 320
},
"normalizedtitle": "Maya Rudolph",
"description": "American comedic actress"
},
{
"views": 62315,
"rank": 30,
"title": "Johnny_Depp",
"pageid": 71870,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/JohnnyDeppHWOFJune2013.jpg/273px-JohnnyDeppHWOFJune2013.jpg",
"width": 273,
"height": 320
},
"normalizedtitle": "Johnny Depp",
"description": "American actor, film producer, and musician"
},
{
"views": 61229,
"rank": 31,
"title": "Donald_Trump",
"pageid": 4848272,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d2/Donald_Trump_August_19%2C_2015_%28cropped%29.jpg/235px-Donald_Trump_August_19%2C_2015_%28cropped%29.jpg",
"width": 235,
"height": 320
},
"normalizedtitle": "Donald Trump",
"description": "German American business magnate, television personality, author and politician"
},
{
"views": 60341,
"rank": 32,
"title": "Children's_Day",
"pageid": 494299,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/ad/Wikipedia_Children%27s_Day.png/320px-Wikipedia_Children%27s_Day.png",
"width": 320,
"height": 280
},
"normalizedtitle": "Children's Day",
"description": "day to honor children globally"
},
{
"views": 58134,
"rank": 35,
"title": "Louis_XIV_of_France",
"pageid": 18553,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5f/Louis_XIV_of_France.jpg/225px-Louis_XIV_of_France.jpg",
"width": 225,
"height": 320
},
"normalizedtitle": "Louis XIV of France",
"description": "King of France and Navarra, from 1643 to 1715"
},
{
"views": 56939,
"rank": 36,
"title": "X-Men_(film_series)",
"pageid": 11891433,
"normalizedtitle": "X-Men (film series)",
"description": "film series"
},
{
"views": 55852,
"rank": 37,
"title": "Michael_Jace",
"pageid": 4238332,
"normalizedtitle": "Michael Jace",
"description": "American actor"
},
{
"views": 54683,
"rank": 38,
"title": "List_of_Bollywood_films_of_2016",
"pageid": 44953417,
"normalizedtitle": "List of Bollywood films of 2016",
"description": "Wikimedia list article"
},
{
"views": 54645,
"rank": 39,
"title": "List_of_Person_of_Interest_episodes",
"pageid": 32796719,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Person_of_Interest_logo.svg/320px-Person_of_Interest_logo.svg.png",
"width": 320,
"height": 107
},
"normalizedtitle": "List of Person of Interest episodes",
"description": "Wikimedia list article"
},
{
"views": 53441,
"rank": 40,
"title": "Stoner_(novel)",
"pageid": 21337639,
"normalizedtitle": "Stoner (novel)",
"description": "1965 novel by the American writer John Williams"
},
{
"views": 52457,
"rank": 41,
"title": "Warcraft_(film)",
"pageid": 39701440,
"normalizedtitle": "Warcraft (film)",
"description": "2016 film"
},
{
"views": 51324,
"rank": 42,
"title": "Rosenhan_experiment",
"pageid": 449532,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Center_building_at_Saint_Elizabeths%2C_August_23%2C_2006.jpg/320px-Center_building_at_Saint_Elizabeths%2C_August_23%2C_2006.jpg",
"width": 320,
"height": 241
},
"normalizedtitle": "Rosenhan experiment",
"description": "psychological experiment"
},
{
"views": 51299,
"rank": 43,
"title": "Emilia_Clarke",
"pageid": 30175038,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Emilia_Clarke_by_Gage_Skidmore_2.jpg/260px-Emilia_Clarke_by_Gage_Skidmore_2.jpg",
"width": 260,
"height": 320
},
"normalizedtitle": "Emilia Clarke",
"description": "English actress"
},
{
"views": 50895,
"rank": 44,
"title": "Elizabeth_Holmes",
"pageid": 43573275,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b3/Elizabeth_Holmes_2014_%28cropped%29.jpg/277px-Elizabeth_Holmes_2014_%28cropped%29.jpg",
"width": 277,
"height": 320
},
"normalizedtitle": "Elizabeth Holmes",
"description": "American business executive"
},
{
"views": 50728,
"rank": 46,
"title": "Stephen_Hawking",
"pageid": 19376148,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/eb/Stephen_Hawking.StarChild.jpg/223px-Stephen_Hawking.StarChild.jpg",
"width": 223,
"height": 320
},
"normalizedtitle": "Stephen Hawking",
"description": "British theoretical physicist, cosmologist, and author"
},
{
"views": 50408,
"rank": 48,
"title": "Harry_Potter_and_the_Cursed_Child",
"pageid": 47083555,
"normalizedtitle": "Harry Potter and the Cursed Child"
},
{
"views": 49764,
"rank": 49,
"title": "Female_genital_mutilation",
"pageid": 11408,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Campaign_road_sign_against_female_genital_mutilation_%28cropped%29_2.jpg/320px-Campaign_road_sign_against_female_genital_mutilation_%28cropped%29_2.jpg",
"width": 320,
"height": 212
},
"normalizedtitle": "Female genital mutilation",
"description": "controversial cultural ritual"
},
{
"views": 49670,
"rank": 50,
"title": "June_1",
"pageid": 15856,
"normalizedtitle": "June 1",
"description": "date"
}
]
}

View file

@ -0,0 +1,700 @@
{
"date": "2016-11-06Z",
"articles": [
{
"views": 505068,
"rank": 4,
"title": "Elizabeth_II",
"pageid": 12153654,
"extract": "Elizabeth II (Elizabeth Alexandra Mary; born 21 April 1926) has been Queen of the United Kingdom, Canada, Australia, and New Zealand since 1952. She is also Head of the Commonwealth and the queen of 12 countries that have become independent since her accession: Jamaica, Barbados, the Bahamas, Grenada, Papua New Guinea, Solomon Islands, Tuvalu, Saint Lucia, Saint Vincent and the Grenadines, Belize, Antigua and Barbuda, and Saint Kitts and Nevis.\nElizabeth was born in London as the first child of the Duke and Duchess of York, later King George VI and Queen Elizabeth. She was educated privately at home. Her father acceded to the throne on the abdication of his brother Edward VIII in 1936, from which time she was the heir presumptive.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/Queen_Elizabeth_II_March_2015.jpg/243px-Queen_Elizabeth_II_March_2015.jpg",
"width": 243,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-04T23:10:26Z",
"description": "monarch of 16 sovereign states, former monarch of another 16, and head of the Commonwealth of Nations",
"normalizedtitle": "Elizabeth II"
},
{
"views": 338421,
"rank": 9,
"title": "George_VI",
"pageid": 46755,
"extract": "George VI (Albert Frederick Arthur George; 14 December 1895 6 February 1952) was King of the United Kingdom and the Dominions of the British Commonwealth from 11 December 1936 until his death. He was the last Emperor of India and the first Head of the Commonwealth.\nKnown as Albert until his accession, George VI was born in the reign of his great-grandmother Queen Victoria, and was named after his great-grandfather Albert, Prince Consort. As the second son of King George V, he was not expected to inherit the throne and spent his early life in the shadow of his elder brother, Edward. He attended naval college as a teenager, and served in the Royal Navy and Royal Air Force during the First World War.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b8/King_George_VI_of_England%2C_formal_photo_portrait%2C_circa_1940-1946.jpg/232px-King_George_VI_of_England%2C_formal_photo_portrait%2C_circa_1940-1946.jpg",
"width": 232,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T12:13:59Z",
"description": "King of the United Kingdom",
"normalizedtitle": "George VI"
},
{
"views": 299955,
"rank": 10,
"title": "Princess_Margaret,_Countess_of_Snowdon",
"pageid": 38567,
"extract": "Princess Margaret, Countess of Snowdon, CI, GCVO, GCStJ (Margaret Rose; 21 August 1930 9 February 2002), often known as a child as Princess Margaret Rose but later simply as Princess Margaret, was the younger daughter of King George VI and Queen Elizabeth, and the only sibling of Queen Elizabeth II.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e1/Princess_Margaret.jpg/205px-Princess_Margaret.jpg",
"width": 205,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-06T05:14:34Z",
"description": "sibling of Queen Elizabeth II",
"normalizedtitle": "Princess Margaret, Countess of Snowdon"
},
{
"views": 292329,
"rank": 11,
"title": "Prince_Philip,_Duke_of_Edinburgh",
"pageid": 62093,
"extract": "Prince Philip, Duke of Edinburgh (Philip Mountbatten; born Prince Philip of Greece and Denmark on 10 June 1921) is the husband of Queen Elizabeth II.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Prince_Philip_March_2015.jpg/202px-Prince_Philip_March_2015.jpg",
"width": 202,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T09:44:32Z",
"description": "member of the British Royal Family, consort to Queen Elizabeth II",
"normalizedtitle": "Prince Philip, Duke of Edinburgh"
},
{
"views": 264067,
"rank": 12,
"title": "Doctor_Strange_(film)",
"pageid": 41668588,
"extract": "Doctor Strange is a 2016 American superhero film featuring the Marvel Comics character of the same name, produced by Marvel Studios and distributed by Walt Disney Studios Motion Pictures. It is the fourteenth film of the Marvel Cinematic Universe (MCU). The film is directed by Scott Derrickson, who wrote the film with Jon Spaihts and C. Robert Cargill, and stars Benedict Cumberbatch, Chiwetel Ejiofor, Rachel McAdams, Benedict Wong, Michael Stuhlbarg, Benjamin Bratt, Scott Adkins, Mads Mikkelsen, and Tilda Swinton. In Doctor Strange, surgeon Stephen Strange learns the mystic arts from the Ancient One after a career-ending car accident.\nVarious incarnations of a Doctor Strange film have been in development since the mid-1980s until Paramount Pictures acquired the film rights in April 2005 on behalf of Marvel Studios.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Doctor_Strange_cast_by_Gage_Skidmore.jpg/320px-Doctor_Strange_cast_by_Gage_Skidmore.jpg",
"width": 320,
"height": 213
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T09:09:38Z",
"description": "2016 superhero film produced by Marvel Studios",
"normalizedtitle": "Doctor Strange (film)"
},
{
"views": 259789,
"rank": 13,
"title": "Bum_flap",
"pageid": 2028361,
"extract": "The bum or butt flap is a piece of removable material that hangs from the waist to cover the rear end. The flap is of ambiguous origin, but probably was originally intended to reduce abrasive wear to pants. Pavement can rapidly wear the seat of pants, and flaps act as replaceable buffer material. They also provide some protection from damp or cold surfaces. The freely swinging flap dries faster than wet pants, and can be easier to clean.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Heavy_butt_flap.jpg/320px-Heavy_butt_flap.jpg",
"width": 320,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-06T11:39:26Z",
"normalizedtitle": "Bum flap"
},
{
"views": 227664,
"rank": 14,
"title": "United_States_presidential_election,_2016",
"pageid": 21377251,
"extract": "The United States presidential election of 2016, scheduled for Tuesday, November 8, 2016, will be the 58th quadrennial U.S. presidential election.\nVoters will select presidential electors, who in turn will vote, based on the results of their jurisdiction, for a new president and vice president through the Electoral College. The term limit established in the Twenty-second Amendment to the United States Constitution prevents the incumbent president, Barack Obama of the Democratic Party, from being elected to a third term. The 2016 election will determine the 45th President and 48th Vice President of the United States.\nThe series of presidential primary elections and caucuses took place between February and June 2016, staggered among the 50 states, the District of Columbia and U.S. territories.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/ElectoralCollege2016.svg/320px-ElectoralCollege2016.svg.png",
"width": 320,
"height": 186
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T13:22:23Z",
"description": "58th election of President of the United States",
"normalizedtitle": "United States presidential election, 2016"
},
{
"views": 213643,
"rank": 16,
"title": "New_Cult_Awareness_Network",
"pageid": 37917973,
"extract": "The \"New Cult Awareness Network\" (NCAN, often referred to as simply the \"Cult Awareness Network\", though other than inheriting the name, it is unrelated to that older group) is an organization that provides information about cults, and is owned and operated by associates of the Church of Scientology, itself categorized in many countries as a cult. It was formed in 1996, with the name purchased from the now defunct Cult Awareness Network, an organization that provided information on groups it considered to be cults, and that strongly opposed Scientology.\nThe \"New CAN\" organization (also known as the Foundation for Religious Freedom) has caused both confusion and controversy among academics and its opponents. Board members of the \"Old CAN\" have characterized it as a front group for the Church of Scientology. In December 1997, 60 Minutes profiled the controversy regarding the history of the \"Old CAN\" and the \"New CAN\", with host Lesley Stahl noting, \"Now, when you call looking for information about a cult, chances are the person you're talking to is a Scientologist\".",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/7/75/United_States_Bankruptcy_Court_Seal.png",
"width": 192,
"height": 192
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T01:01:52Z",
"normalizedtitle": "New Cult Awareness Network"
},
{
"views": 203740,
"rank": 17,
"title": "The_Crown_(TV_series)",
"pageid": 47048067,
"extract": "The Crown is an American-British television drama series, created and written by Peter Morgan and produced by Left Bank Pictures for Netflix. The show is a biographical story about the reign of Queen Elizabeth II of the United Kingdom. The first season, comprising 10 one-hour episodes, was released in its entirety on November 4, 2016. A second season has already been commissioned.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/Royal_Cypher_of_Queen_Elizabeth_II.svg/279px-Royal_Cypher_of_Queen_Elizabeth_II.svg.png",
"width": 279,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T13:53:33Z",
"normalizedtitle": "The Crown (TV series)"
},
{
"views": 200110,
"rank": 18,
"title": "Donald_Trump",
"pageid": 4848272,
"extract": "Donald John Trump (born June 14, 1946) is an American businessman, television producer, and politician who is the Republican Party nominee for President of the United States in the 2016 election. He is the chairman and president of The Trump Organization, which is the principal holding company for his real estate ventures and other business interests. During his career, Trump has built office towers, hotels, casinos, golf courses, and other branded facilities worldwide.\nTrump was born and raised in New York City, attended the New York Military Academy from age 13, and received a bachelor's degree in economics from the Wharton School of the University of Pennsylvania in 1968. In 1971 he was given control of his father Fred Trump's real estate and construction firm and later renamed it The Trump Organization, rising to public prominence shortly thereafter.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d2/Donald_Trump_August_19%2C_2015_%28cropped%29.jpg/240px-Donald_Trump_August_19%2C_2015_%28cropped%29.jpg",
"width": 240,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T13:02:18Z",
"description": "American business magnate, television personality, author and politician",
"normalizedtitle": "Donald Trump"
},
{
"views": 199523,
"rank": 19,
"title": "Winston_Churchill",
"pageid": 33265,
"extract": "Sir Winston Leonard Spencer-Churchill, KG, OM, CH, TD, PC, DL, FRS, RA (30 November 1874 24 January 1965) was a British statesman who was the Prime Minister of the United Kingdom from 1940 to 1945 and again from 1951 to 1955. Churchill was also an officer in the British Army, a non-academic historian, a writer (as Winston S. Churchill), and an artist. He won the Nobel Prize in Literature in 1953 for his overall, lifetime body of work. In 1963, he was the first of only eight people to be made an honorary citizen of the United States.\nChurchill was born into the family of the Dukes of Marlborough, a branch of the Spencer family.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/Sir_Winston_Churchill_-_19086236948.jpg/250px-Sir_Winston_Churchill_-_19086236948.jpg",
"width": 250,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-06T17:25:59Z",
"description": "Prime Minister of the United Kingdom during World War II",
"normalizedtitle": "Winston Churchill"
},
{
"views": 180299,
"rank": 21,
"title": "Doctor_Strange",
"pageid": 150076,
"extract": "Dr. Stephen Vincent Strange, also known as Doctor Strange, is a fictional superhero appearing in American comic books published by Marvel Comics. Created by artist and character conceptualist Steve Ditko, the character first appeared in Strange Tales #110 (cover-dated July 1963). A former neurosurgeon, Strange serves as the Sorcerer Supreme, the primary protector of Earth against magical and mystical threats. Debuting in the Silver Age of comics, the character has been featured in several comic book series and adapted in a variety of media including video games, an animated television show, and films.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/en/f/f6/Doctor_Strange_Spider-Man.jpg",
"width": 250,
"height": 189
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T13:38:13Z",
"description": "superhero appearing in Marvel Comics publications and related media",
"normalizedtitle": "Doctor Strange"
},
{
"views": 166624,
"rank": 22,
"title": "Edward_VIII",
"pageid": 18835362,
"extract": "Edward VIII (Edward Albert Christian George Andrew Patrick David; 23 June 1894 28 May 1972) was King of the United Kingdom and the Dominions of the British Empire, and Emperor of India, from 20 January 1936 until his abdication on 11 December the same year.\nEdward was the eldest son of King George V and Queen Mary. He was created Prince of Wales on his sixteenth birthday, nine weeks after his father succeeded as king. As a young man, he served in the British Army during the First World War and undertook several overseas tours on behalf of his father.\nEdward became king on his father's death in early 1936.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a3/HRH_The_Prince_of_Wales_No_4_%28HS85-10-36416%29.jpg/237px-HRH_The_Prince_of_Wales_No_4_%28HS85-10-36416%29.jpg",
"width": 237,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T08:07:59Z",
"description": "king of the United Kingdom and its dominions in 1936",
"normalizedtitle": "Edward VIII"
},
{
"views": 156042,
"rank": 23,
"title": "The_Ultimate_Fighter:_Latin_America_3",
"pageid": 50694541,
"extract": "The Ultimate Fighter: Latin America 3 will be an installment of the Ultimate Fighting Championship (UFC)-produced reality television series The Ultimate Fighter.\nOn May 31, 2016 the UFC announced that the 16 competitors for the season would be made up of lightweight fighters from various locations around Latin America.\nThe cast consisted of fighters from 9 countries: Bedoya, from Colombia, Castillo, from Nicaragua, Cárdenas and Villaseca, from Chile, Chalo, from Venezuela, Flores, from Bolivia, Puelles, from Peru, Ganin and Rojo, from Argentina, Zamora, from Costa Rica and Bravo, Martínez, Quintanar, Rodríguez, Sabori and Villegas, from Mexico.\nThe coaches for the season are former UFC Light Heavyweight champions Forrest Griffin and Chuck Liddell. Both retired fighters have been coaches on previous The Ultimate Fighter installments.",
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-06T17:55:53Z",
"normalizedtitle": "The Ultimate Fighter: Latin America 3"
},
{
"views": 143515,
"rank": 26,
"title": "Manny_Pacquiao",
"pageid": 916099,
"extract": "Emmanuel \"Manny\" Dapidran Pacquiao, PLH (/ˈpæki.aʊ/ PAK-ee-ow; Tagalog: [pɐkˈjaʊ]; born December 17, 1978) is a Filipino professional boxer and politician, currently serving as Senator of the Philippines. In boxing he has held the lineal welterweight title since April 2016, and the WBO welterweight title since November 2016.\nPacquiao is generally considered to be one of the greatest boxers of all time as he is the first and only eight-division world champion, having won ten major world titles, as well as being the first boxer to win the lineal championship in five different weight classes. Pacquiao is also the third boxer in history to win major world titles in three of the original eight weight divisions of boxing, also known as the \"glamour divisions\" (flyweight, featherweight, and welterweight).\nHe was named \"Fighter of the Decade\" for the 2000s by the Boxing Writers Association of America (BWAA), WBC, and WBO. He is also a three-time Ring magazine and BWAA Fighter of the Year, winning the award in 2006, 2008, and 2009; and the Best Fighter ESPY Award in 2009 and 2011.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/81/Sarangani_Lone_District_Representative_Manny_Pacquiao_%28cropped%29.jpg/244px-Sarangani_Lone_District_Representative_Manny_Pacquiao_%28cropped%29.jpg",
"width": 244,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T13:53:08Z",
"description": "Filipino professional boxer and politician",
"normalizedtitle": "Manny Pacquiao"
},
{
"views": 141293,
"rank": 27,
"title": "Daylight_saving_time",
"pageid": 47548,
"extract": "Daylight saving time (DST) or summer time is the practice of advancing clocks during summer months by one hour so that evening daylight lasts an hour longer, while sacrificing normal sunrise times. Typically, regions with summer time adjust clocks forward one hour close to the start of spring and adjust them backward in the autumn to standard time.\nNew Zealander George Hudson proposed the idea of daylight saving in 1895. The German Empire and Austria-Hungary organized the first nationwide implementation, starting on April 30, 1916. Many countries have used it at various times since then, particularly since the energy crisis of the 1970s.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/16/DST_Countries_Map.png/320px-DST_Countries_Map.png",
"width": 320,
"height": 160
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T00:28:56Z",
"description": "practice of advancing clocks so that evenings have more daylight and mornings have less",
"normalizedtitle": "Daylight saving time"
},
{
"views": 130636,
"rank": 29,
"title": "Ten_Commandments",
"pageid": 2539671,
"extract": "The Ten Commandments, also known as the Decalogue, are a set of biblical principles relating to ethics and worship, which play a fundamental role in Judaism and Christianity. The commandments include instructions to worship only God, to honour one's parents, and to keep the sabbath, as well as prohibitions against idolatry, blasphemy, murder, adultery, theft, dishonesty, and coveting. Different religious groups follow different traditions for interpreting and numbering them.\nThe Ten Commandments are listed twice in the Hebrew Bible, first at Exodus 20:117, and then at Deuteronomy 5:621. Both versions state that God inscribed them on two stone tablets, which he gave to Moses on Mount Sinai.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/15/Vitrail_de_synagogue-Mus%C3%A9e_alsacien_de_Strasbourg.jpg/319px-Vitrail_de_synagogue-Mus%C3%A9e_alsacien_de_Strasbourg.jpg",
"width": 319,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-06T20:56:03Z",
"description": "Part of the Law of Moses appearing in Exodus 20, Deuteronomy in Hebrew Bible",
"normalizedtitle": "Ten Commandments"
},
{
"views": 125859,
"rank": 30,
"title": "Hillary_Clinton",
"pageid": 5043192,
"extract": "Hillary Diane Rodham Clinton (/ˈhɪləri daɪˈæn ˈrɒdəm ˈklɪntən/; born October 26, 1947) is an American politician and the Democratic Party nominee for President of the United States in the 2016 election. She served as the 67th United States Secretary of State from 2009 to 2013, the junior United States Senator representing New York from 2001 to 2009, First Lady of the United States during the presidency of her husband Bill Clinton from 1993 to 2001, and First Lady of Arkansas during his governorship from 1979 to 1981 and again from 1983 to 1992.\nBorn in Chicago and raised in the suburban town of Park Ridge, Illinois, Clinton attended Wellesley College, graduating in 1969, and earned a J.D. from Yale Law School in 1973. After serving as a congressional legal counsel, she moved to Arkansas and married Bill Clinton in 1975. In 1977, she co-founded Arkansas Advocates for Children and Families.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/27/Hillary_Clinton_official_Secretary_of_State_portrait_crop.jpg/256px-Hillary_Clinton_official_Secretary_of_State_portrait_crop.jpg",
"width": 256,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T11:28:52Z",
"description": "American politician, former First Lady of the United States, U.S. Senator, and U.S. Secretary of State",
"normalizedtitle": "Hillary Clinton"
},
{
"views": 125325,
"rank": 31,
"title": "Benedict_Cumberbatch",
"pageid": 2275990,
"extract": "Benedict Timothy Carlton Cumberbatch CBE (born 19 July 1976) is an English actor and film producer who has performed in film, television, theatre and radio. The son of actors Timothy Carlton and Wanda Ventham, he graduated from the University of Manchester and continued his training at the London Academy of Music and Dramatic Art, obtaining a Master of Arts in Classical Acting. He first performed at the Open Air Theatre, Regent's Park in Shakespearean productions and has portrayed George Tesman in Richard Eyre's revival of Hedda Gabler in 2005. Since then he has starred in the Royal National Theatre productions After the Dance (2010) and Frankenstein (2011). In 2015, he played William Shakespeare's Hamlet at the Barbican Theatre.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4b/Benedict_Cumberbatch_SDCC_2014.jpg/239px-Benedict_Cumberbatch_SDCC_2014.jpg",
"width": 239,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-06T00:37:22Z",
"description": "English actor and film producer",
"normalizedtitle": "Benedict Cumberbatch"
},
{
"views": 122203,
"rank": 32,
"title": "Guy_Fawkes_Night",
"pageid": 979165,
"extract": "Guy Fawkes Night, also known as Guy Fawkes Day, Bonfire Night and Firework Night, is an annual commemoration observed on 5 November, primarily in Great Britain. Its history begins with the events of 5 November 1605, when Guy Fawkes, a member of the Gunpowder Plot, was arrested while guarding explosives the plotters had placed beneath the House of Lords. Celebrating the fact that King James I had survived the attempt on his life, people lit bonfires around London, and months later the introduction of the Observance of 5th November Act enforced an annual public day of thanksgiving for the plot's failure.\nWithin a few decades Gunpowder Treason Day, as it was known, became the predominant English state commemoration, but as it carried strong Protestant religious overtones it also became a focus for anti-Catholic sentiment. Puritans delivered sermons regarding the perceived dangers of popery, while during increasingly raucous celebrations common folk burnt effigies of popular hate-figures, such as the pope.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Windsor_castle_guyfawkesnight1776.jpg/320px-Windsor_castle_guyfawkesnight1776.jpg",
"width": 320,
"height": 208
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T03:13:18Z",
"description": "annual commemoration",
"normalizedtitle": "Guy Fawkes Night"
},
{
"views": 121284,
"rank": 33,
"title": "Charles,_Prince_of_Wales",
"pageid": 125248,
"extract": "Charles, Prince of Wales (Charles Philip Arthur George; born 14 November 1948), is the eldest child and heir apparent of Queen Elizabeth II. Known alternatively in South West England as Duke of Cornwall and in Scotland as Duke of Rothesay, he is the longest-serving heir apparent in British history, having held the position since 1952. He is also the oldest person to be next in line to the throne since Sophia of Hanover (the heir presumptive to Queen Anne), who died in 1714 at the age of 83.\nCharles was born at Buckingham Palace as the first grandchild of King George VI and Queen Elizabeth. He was educated at Cheam and Gordonstoun Schools, which his father, Prince Philip, Duke of Edinburgh, had attended as a child, as well as the Timbertop campus of Geelong Grammar School in Victoria, Australia. After earning a bachelor of arts degree from Trinity College, Cambridge, Charles served in the Royal Navy from 1971 to 1976.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4f/Charles%2C_Prince_of_Wales_at_COP21.jpg/256px-Charles%2C_Prince_of_Wales_at_COP21.jpg",
"width": 256,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-10-30T20:33:57Z",
"description": "son of Queen Elizabeth II of the United Kingdom",
"normalizedtitle": "Charles, Prince of Wales"
},
{
"views": 114612,
"rank": 34,
"title": "Guy_Fawkes",
"pageid": 12707,
"extract": "Guy Fawkes (/ˈɡaɪ ˈːks/; 13 April 1570 31 January 1606), also known as Guido Fawkes, the name he adopted while fighting for the Spanish, was a member of a group of provincial English Catholics who planned the failed Gunpowder Plot of 1605.\nFawkes was born and educated in York. His father died when Fawkes was eight years old, after which his mother married a recusant Catholic. Fawkes converted to Catholicism and left for the continent, where he fought in the Eighty Years' War on the side of Catholic Spain against Protestant Dutch reformers in the Low Countries. He travelled to Spain to seek support for a Catholic rebellion in England without success.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d0/Guy_Fawkes_by_Cruikshank.jpg/272px-Guy_Fawkes_by_Cruikshank.jpg",
"width": 272,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-05T20:28:00Z",
"description": "member of the Gunpowder Plot of 1605",
"normalizedtitle": "Guy Fawkes"
},
{
"views": 109640,
"rank": 35,
"title": "Peter_Townsend_(RAF_officer)",
"pageid": 3642068,
"extract": "Group Captain Peter Woolridge Townsend CVO, DSO, DFC & Bar (22 November 1914 19 June 1995) was Equerry to King George VI 19441952 and held the same position for Queen Elizabeth II 19521953. Group Captain Townsend is best known for his romance with Princess Margaret.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d7/Royal_Air_Force_Fighter_Command%2C_1939-1945._CH89.jpg/320px-Royal_Air_Force_Fighter_Command%2C_1939-1945._CH89.jpg",
"width": 320,
"height": 242
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-06T01:05:09Z",
"description": "British flying ace",
"normalizedtitle": "Peter Townsend (RAF officer)"
},
{
"views": 102322,
"rank": 36,
"title": "Westworld_(TV_series)",
"pageid": 43369485,
"extract": "Westworld is an American science fiction thriller television series created by Jonathan Nolan and Lisa Joy for HBO. It is based on the 1973 film of the same name, which was written and directed by American novelist Michael Crichton, and to a lesser extent on the 1976 sequel Futureworld. It is the second TV series based on the two films, the first being the short-lived 1980 series Beyond Westworld. Nolan and Joy serve as executive producers along with J. J. Abrams, Jerry Weintraub and Bryan Burk, with Nolan directing the pilot. The first episode premiered on October 2, 2016. The first season consists of ten episodes.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/MichaelCrichton_2.jpg/244px-MichaelCrichton_2.jpg",
"width": 244,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T11:05:55Z",
"description": "science fiction thriller television series",
"normalizedtitle": "Westworld (TV series)"
},
{
"views": 101930,
"rank": 37,
"title": "List_of_search_engines",
"pageid": 429700,
"extract": "This is a list of search engines, including web search engines, selection-based search engines, metasearch engines, desktop search tools, and web portals and vertical market websites that have a search facility for online databases. For a list of search engine software, see List of enterprise search vendors.",
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-02T05:13:31Z",
"description": "Wikimedia list article",
"normalizedtitle": "List of search engines"
},
{
"views": 100982,
"rank": 38,
"title": "Ae_Dil_Hai_Mushkil",
"pageid": 48207620,
"extract": "Ae Dil Hai Mushkil (English: Oh My Dear Heart, It's Tough) is a 2016 Indian romantic drama film written and directed by Karan Johar. It features Aishwarya Rai Bachchan, Ranbir Kapoor and Anushka Sharma in lead roles. It was released on 28 October 2016 on the Diwali weekend.",
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T11:47:46Z",
"description": "2016 Hindi film",
"normalizedtitle": "Ae Dil Hai Mushkil"
},
{
"views": 100787,
"rank": 39,
"title": "List_of_wealthiest_historical_figures",
"pageid": 12944918,
"extract": "The list of the wealthiest historical figures gathers published estimates as to the (inflation-adjusted) net-worth and fortunes of the wealthiest historical figures in comparison. Due to problems arising from different definitions of wealth, ways of measuring it, various economic models throughout history, as well as multiple other reasons—this article discusses the wealthiest people in the following separate historical periods: Antiquity, Middle Ages and modern period. Accordingly—because of the previously mentioned difficulties—it is not possible to determine the single richest person in all of history.\nFor the modern period, wealth can be measured more or less objectively via inflation adjustment, e.g. comparing the nominal GDP of the United States of the respective periods, and then converting it into contemporary United States dollars.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6f/John_D._Rockefeller_1885.jpg/221px-John_D._Rockefeller_1885.jpg",
"width": 221,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T00:47:40Z",
"description": "Wikimedia list article",
"normalizedtitle": "List of wealthiest historical figures"
},
{
"views": 94126,
"rank": 40,
"title": "Solange_Knowles",
"pageid": 543892,
"extract": "Solange Piaget Knowles (/soʊˈlɑːnʒ/; born June 24, 1986) is an American singer, songwriter, model, and actress. Knowles was born in Houston, Texas to Mathew and Tina Knowles. Expressing an interest in music from an early age, Knowles had several temporary stints in Destiny's Child, before signing with her father's Music World Entertainment label. At age 16, Knowles released her first studio album Solo Star (2002). In 2004, Knowles married Daniel Smith, eventually giving birth to their son Daniel Julez J. Smith Jr., which prompted a move to Idaho.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/2016-03-30_16h14_35.png/204px-2016-03-30_16h14_35.png",
"width": 204,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T07:50:47Z",
"description": "musician",
"normalizedtitle": "Solange Knowles"
},
{
"views": 91733,
"rank": 41,
"title": "Mary_of_Teck",
"pageid": 48419,
"extract": "Mary of Teck (Victoria Mary Augusta Louise Olga Pauline Claudine Agnes; 26 May 1867 24 March 1953) was Queen of the United Kingdom and the British Dominions and Empress of India as the wife of King-Emperor George V.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/fe/Queenmaryformalportrait_edit3.jpg/229px-Queenmaryformalportrait_edit3.jpg",
"width": 229,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T13:43:50Z",
"description": "Queen consort of the United Kingdom Empress of India",
"normalizedtitle": "Mary of Teck"
},
{
"views": 91593,
"rank": 42,
"title": "Queen_Elizabeth_The_Queen_Mother",
"pageid": 46744,
"extract": "Elizabeth Angela Marguerite Bowes-Lyon (4 August 1900 30 March 2002) was the wife of King George VI and the mother of Queen Elizabeth II and Princess Margaret, Countess of Snowdon. She was Queen consort of the United Kingdom and the Dominions from her husband's accession in 1936 until his death in 1952, after which she was known as Queen Elizabeth The Queen Mother, to avoid confusion with her daughter. She was the last Empress consort of India.\nBorn into a family of British nobility as The Honourable Elizabeth Bowes-Lyon, she became Lady Elizabeth Bowes-Lyon when her father inherited the Scottish Earldom of Strathmore and Kinghorne in 1904. She came to prominence in 1923 when she married Albert, Duke of York, the second son of King George V and Queen Mary.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/Queen_Elizabeth_the_Queen_Mother_portrait.jpg/252px-Queen_Elizabeth_the_Queen_Mother_portrait.jpg",
"width": 252,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-02T16:49:39Z",
"description": "Queen consort of King George VI, mother of Queen Elizabeth II",
"normalizedtitle": "Queen Elizabeth The Queen Mother"
},
{
"views": 91570,
"rank": 43,
"title": "Jessie_Vargas",
"pageid": 27158754,
"extract": "Jessie Vargas (born May 10, 1989) is an American professional boxer. He is a former two-weight world champion, having held the WBA (Regular) and IBO super lightweight titles in 2014, and the WBO welterweight title in 2016.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Jessie_Vargas_2010.jpg/279px-Jessie_Vargas_2010.jpg",
"width": 279,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T13:29:51Z",
"description": "American boxer",
"normalizedtitle": "Jessie Vargas"
},
{
"views": 90709,
"rank": 44,
"title": "Electoral_College_(United_States)",
"pageid": 85533,
"extract": "The United States Electoral College is the body that elects the President and Vice President of the United States every four years. Citizens of the United States do not directly elect the president or the vice president; instead they choose \"electors\", who usually pledge to vote for particular candidates.\nThe number of electors in each state is equal to the number of members of Congress to which the state is entitled, while the Twenty-third Amendment grants the District of Columbia the same number of electors as the least populous state, currently three. Therefore, there are currently 538 electors, corresponding to the 435 Representatives and 100 Senators, plus the three additional electors from the District of Columbia. The Constitution bars any federal official, elected or appointed, from being an elector.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/44/ElectoralCollege2012.svg/320px-ElectoralCollege2012.svg.png",
"width": 320,
"height": 186
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T09:30:56Z",
"description": "institution that officially elects the President and Vice President of the United States",
"normalizedtitle": "Electoral College (United States)"
},
{
"views": 89809,
"rank": 45,
"title": "Deaths_in_2016",
"pageid": 48857868,
"extract": "This is a chronology of deaths in 2016. Names are reported under the date of death. Names under each date are reported in alphabetical order by surname or pseudonym. Deaths of non-humans are reported here if they first have their own Wikipedia article. Notable persons without an article can be listed for one month after death to prompt creation of one.",
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T12:31:12Z",
"description": "Wikimedia list article",
"normalizedtitle": "Deaths in 2016"
},
{
"views": 89602,
"rank": 46,
"title": "USS_Zumwalt",
"pageid": 4706917,
"extract": "USS Zumwalt (DDG-1000) is a guided missile destroyer of the United States Navy. She is the lead ship of the Zumwalt class and the first ship to be named for Admiral Elmo Zumwalt. Zumwalt has stealth capabilities, having a radar cross-section akin to a fishing boat despite her large size. On 7 December 2015, Zumwalt began her sea trial preparatory to joining the Pacific Fleet. The ship was commissioned in Baltimore on 15 October 2016.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b0/USS_Zumwalt_%28DDG-1000%29_at_night.jpg/320px-USS_Zumwalt_%28DDG-1000%29_at_night.jpg",
"width": 320,
"height": 213
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-10-25T23:32:29Z",
"description": "guided missile destroyer of the United States Navy",
"normalizedtitle": "USS Zumwalt"
},
{
"views": 86474,
"rank": 47,
"title": "Anti-miscegenation_laws_in_the_United_States",
"pageid": 31646377,
"extract": "Anti-miscegenation laws were a part of American law since before the United States was established and remained so until ruled unconstitutional in 1967 by the U.S. Supreme Court in Loving v. Virginia. The term miscegenation was first used in 1863, during the American Civil War, by American journalists to discredit the abolitionist movement by stirring up debate over the prospect of blackwhite intermarriage after the abolition of slavery. In those of the original Thirteen Colonies that became states and enacted such laws, they were enacted as state law in the early 18th century; a century or more after the complete racialization of slavery.\nIn the United States, anti-miscegenation laws (also known as miscegenation laws) were state laws passed by individual states to prohibit miscegenation, nowadays more commonly referred to as interracial marriage and interracial sex.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/US_miscegenation.svg/320px-US_miscegenation.svg.png",
"width": 320,
"height": 198
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-05T21:43:47Z",
"normalizedtitle": "Anti-miscegenation laws in the United States"
},
{
"views": 84013,
"rank": 48,
"title": "UFC_205",
"pageid": 50527598,
"extract": "UFC 205: Alvarez vs. McGregor is an upcoming mixed martial arts event promoted by the Ultimate Fighting Championship that will be held on November 12, 2016 at Madison Square Garden in New York City, New York.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/06/Eddie_Alvarez.jpg/274px-Eddie_Alvarez.jpg",
"width": 274,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T02:42:58Z",
"description": "mixed martial arts event",
"normalizedtitle": "UFC 205"
},
{
"views": 82267,
"rank": 49,
"title": "Wallis_Simpson",
"pageid": 46854,
"extract": "Wallis, Duchess of Windsor (previously Wallis Simpson, Wallis Spencer, and Wallis Warfield; 19 June 1896 24 April 1986) was an American socialite. Her third husband, Prince Edward, Duke of Windsor, formerly King Edward VIII, abdicated his throne to marry her.\nWallis's father died shortly after her birth, and she and her widowed mother were partly supported by their wealthier relatives. Her first marriage, to U.S. naval officer Win Spencer, was punctuated by periods of separation and eventually ended in divorce. In 1934, during her second marriage, to Ernest Simpson, she allegedly became the mistress of Edward, Prince of Wales.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/3/33/Wallis_Simpson_-1936.JPG/252px-Wallis_Simpson_-1936.JPG",
"width": 252,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-06T19:54:20Z",
"description": "Wife of Edward VIII of the United Kingdom",
"normalizedtitle": "Wallis Simpson"
},
{
"views": 82232,
"rank": 50,
"title": "Anne,_Princess_Royal",
"pageid": 125231,
"extract": "Anne, Princess Royal, KG KT GCVO GCStJ QSO GCL CD (Anne Elizabeth Alice Louise; born 15 August 1950) is the second child and only daughter of Queen Elizabeth II and Prince Philip, Duke of Edinburgh. At the time of her birth, she was third in the line of succession, behind her mother and elder brother Charles. She rose to second after her mother's accession, but is currently 12th in line.\nAnne is known for her charitable work, and is patron of over 200 organizations. She is also known for equestrian talents; she won two silver medals (1975) and one gold medal (1971) at the European Eventing Championships, and is the first member of the British Royal Family to have competed in the Olympic Games.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/76/Princess_Anne_October_2015.jpg/216px-Princess_Anne_October_2015.jpg",
"width": 216,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-10-30T15:40:18Z",
"description": "daughter of Elizabeth II",
"normalizedtitle": "Anne, Princess Royal"
},
{
"views": 80353,
"rank": 51,
"title": "Hacksaw_Ridge",
"pageid": 44490039,
"extract": "Hacksaw Ridge is a 2016 American biographical war film directed by Mel Gibson, written by Andrew Knight and Robert Schenkkan, and stars Andrew Garfield, Vince Vaughn, Sam Worthington, Luke Bracey, Hugo Weaving, Ryan Corr, Teresa Palmer, Richard Pyros and Rachel Griffiths. Principal photography began on September 29, 2015 in various locations around New South Wales including Sydney Olympic Park and lasted for 105 days, ending in December 2015.\nIt had its world premiere on September 4, 2016 at the 73rd Venice Film Festival, where it received a 10-minute standing ovation. The film was released in Australia on November 3, 2016 by Icon Film Distribution, and in United States on November 4, 2016, by Summit Entertainment. The film received positive reviews and has grossed $14 million.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d1/Hacksaw_ridge.jpg/320px-Hacksaw_ridge.jpg",
"width": 320,
"height": 180
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T12:58:21Z",
"description": "2016 World War II biographical film",
"normalizedtitle": "Hacksaw Ridge"
},
{
"views": 78798,
"rank": 52,
"title": "Emma_Stone",
"pageid": 3741746,
"extract": "Emily Jean \"Emma\" Stone (born November 6, 1988) is an American actress. Born and raised in Scottsdale, Arizona, Stone was drawn to acting as a child, and her first role was in a theater production of The Wind in the Willows in 2000. As a teenager, she relocated to Los Angeles with her mother, and made her television debut in VH1's In Search of the New Partridge Family (2004), a reality show that produced only an unsold pilot. After a series of small television roles, she won a Young Hollywood Award for her film debut in Superbad (2007), and received positive media attention for her role in Zombieland (2009).\nThe 2010 teen comedy Easy A was Stone's first starring role and earned her nominations for the BAFTA Rising Star Award and a Golden Globe Award.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/fd/Emma_Stone_2014.jpg/248px-Emma_Stone_2014.jpg",
"width": 248,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T09:33:46Z",
"description": "American actress",
"normalizedtitle": "Emma Stone"
},
{
"views": 77025,
"rank": 53,
"title": "Shivaay",
"pageid": 45605536,
"extract": "Shivaay is a 2016 Indian action thriller film directed and produced by Ajay Devgan under his banner Ajay Devgn FFilms. It features Ajay Devgn, Sayyeshaa Saigal, and Erika Kaar in lead roles. Mithoon has composed the film's score and soundtrack. British band The Vamps and composer Jasleen Royal are also a part of the music.\nShivaay was released on 28 October 2016 on the Diwali weekend.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/en/thumb/a/a1/Ajay_Devgan%27s_Shivaay_poster.jpg/240px-Ajay_Devgan%27s_Shivaay_poster.jpg",
"width": 240,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T14:05:12Z",
"normalizedtitle": "Shivaay"
},
{
"views": 76293,
"rank": 54,
"title": "List_of_Black_Mirror_episodes",
"pageid": 38587686,
"extract": "Black Mirror is a British television series created by Charlie Brooker. The series is produced by Zeppotron for Endemol. Regarding the programme's content and structure, Brooker noted, \"each episode has a different cast, a different setting, even a different reality.",
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-05T15:28:08Z",
"description": "Wikimedia list article",
"normalizedtitle": "List of Black Mirror episodes"
},
{
"views": 76068,
"rank": 55,
"title": "Tony_Ferguson",
"pageid": 31689180,
"extract": "Anthony Armand \"Tony\" Ferguson (born February 12, 1984) is an American professional mixed martial artist who is currently signed with the Ultimate Fighting Championship (UFC). Ferguson was the winner of The Ultimate Fighter 13. He competes in the lightweight division and is currently #3 in official UFC lightweight rankings.",
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T12:27:32Z",
"description": "American martial artist",
"normalizedtitle": "Tony Ferguson"
}
]
}

View file

@ -0,0 +1,65 @@
{
"batchcomplete": true,
"query": {
"pages": [
{
"title": "Bean Hollow State Beach",
"coordinates": [
{
"lat": 37.22583333,
"lon": -122.40888889,
"primary": "",
"globe": "earth"
}
],
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/91/Bean_Hollow_State_Beach_2003.jpg/320px-Bean_Hollow_State_Beach_2003.jpg",
"width": 320,
"height": 256
},
"terms": {
"description": [
"state beach in California"
]
}
},
{
"title": "Pescadero, California",
"coordinates": [
{
"lat": 37.255,
"lon": -122.38138889,
"primary": "",
"globe": "earth"
}
],
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/Pescadero_Main_Street.jpg/320px-Pescadero_Main_Street.jpg",
"width": 320,
"height": 263
},
"terms": {
"description": [
"census-designated place in California, USA"
]
}
},
{
"title": "Pescadero State Beach",
"coordinates": [
{
"lat": 37.26194444,
"lon": -122.41333333,
"primary": "",
"globe": "earth"
}
],
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0e/Pescadero_beach.JPG/320px-Pescadero_beach.JPG",
"width": 320,
"height": 213
}
}
]
}
}

View file

@ -0,0 +1,3 @@
{
"batchcomplete": true
}

View file

@ -0,0 +1,20 @@
{
"batchcomplete": true,
"query": {
"pages": [
{
"title": "Bean Hollow State Beach",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/91/Bean_Hollow_State_Beach_2003.jpg/320px-Bean_Hollow_State_Beach_2003.jpg",
"width": 320,
"height": 256
},
"terms": {
"description": [
"state beach in California"
]
}
}
]
}
}

View file

@ -0,0 +1,27 @@
{
"batchcomplete": true,
"query": {
"pages": [
{
"title": "Bean Hollow State Beach",
"coordinates": [
{
"lon": -122.40888889,
"primary": "",
"globe": "earth"
}
],
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/91/Bean_Hollow_State_Beach_2003.jpg/320px-Bean_Hollow_State_Beach_2003.jpg",
"width": 320,
"height": 256
},
"terms": {
"description": [
"state beach in California"
]
}
}
]
}
}

View file

@ -0,0 +1,27 @@
{
"batchcomplete": true,
"query": {
"pages": [
{
"title": "Bean Hollow State Beach",
"coordinates": [
{
"lat": 37.22583333,
"primary": "",
"globe": "earth"
}
],
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/91/Bean_Hollow_State_Beach_2003.jpg/320px-Bean_Hollow_State_Beach_2003.jpg",
"width": 320,
"height": 256
},
"terms": {
"description": [
"state beach in California"
]
}
}
]
}
}

View file

@ -0,0 +1,226 @@
[
{
"links": [
{
"title": "2016_Chicago_Cubs_season",
"extract": "The 2016 Chicago Cubs season was the 145th season of the Chicago Cubs franchise, the 141st in the National League and the Cubs 101st season at Wrigley Field. To celebrate their 100 years at Wrigley, the Cubs wore a patch on their home uniforms and wore 1916 throwback uniforms on July 6.\nThey began the season on April 4, 2016 at the Los Angeles Angels and finished the regular season on October 2, 2016 at the Cincinnati Reds. They finished with the best record in Major League Baseball and won their first National League Central title since the 2008 season, winning by 17½ games. The team also reached the 100 win mark for the first time since 1935 and won 103 total games, the most wins for the franchise since 1910.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/66/Union_Station_during_the_Cubs_2016_World_Series_run_IMG_6998.jpg/240px-Union_Station_during_the_Cubs_2016_World_Series_run_IMG_6998.jpg",
"width": 240,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T02:16:39Z",
"normalizedtitle": "2016 Chicago Cubs season"
},
{
"title": "2016_Cleveland_Indians_season",
"extract": "The 2016 Cleveland Indians season was the 116th season for the franchise and the 23rd season at Progressive Field. The Indians won the American League Central Division for the first time since 2007 and also beat the Boston Red Sox in the Division Series for their first playoff win in nine years. They defeated the Toronto Blue Jays in five games in the American League Championship Series before losing to the Chicago Cubs in seven games in the 2016 World Series. This was their first appearance in the World Series since 1997.",
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-03T21:39:40Z",
"normalizedtitle": "2016 Cleveland Indians season"
},
{
"title": "2016_World_Series",
"extract": "The 2016 World Series was the 112th edition of Major League Baseball's championship series, a best-of-seven playoff between the National League (NL) champion Chicago Cubs and the American League (AL) champion Cleveland Indians, the first meeting of those franchises in postseason history. The Indians had home-field advantage because the AL had won the 2016 All-Star Game. The Cubs defeated the Indians in seven games, their first World Series victory in 108 years. They clinched the Series in Game 7 with an 87 win in extra innings, marking the fifth time that a Game 7 had gone past nine innings, and the first one to have a rain delay, which happened just as the tenth inning was about to start. It was only the sixth time in World Series history that a team came back from a deficit of three games to one to win a championship.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Chicago_Cubs_Host_First_World_Series_Games_in_71_years.webm/320px--Chicago_Cubs_Host_First_World_Series_Games_in_71_years.webm.jpg",
"width": 320,
"height": 180
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T13:31:02Z",
"description": "112th edition of Major League Baseball's championship series",
"normalizedtitle": "2016 World Series"
},
{
"title": "World_Series_Most_Valuable_Player_Award",
"extract": "The World Series Most Valuable Player (MVP) Award is given to the player deemed to have the most impact on his team's performance in the World Series, which is the final round of the Major League Baseball (MLB) postseason. The award was first presented in 1955 as the SPORT Magazine Award, but is now decided during the final game of the Series by a committee of reporters and officials present at the game.\nThe series follows a best-of-seven playoff format, and occurs after the Division Series and the League Championship Series (LCS). It is played by the winners of the National League Championship Series (NLCS) and the American League Championship Series (ALCS). The most recent champions are the Chicago Cubs, who won in the 2016 World Series.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/fb/Ben_Zobrist_with_2016_World_Series_MVP_trophy.jpg/213px-Ben_Zobrist_with_2016_World_Series_MVP_trophy.jpg",
"width": 213,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-05T16:04:29Z",
"description": "baseball award for the most important player in each World Series",
"normalizedtitle": "World Series Most Valuable Player Award"
},
{
"title": "Ben_Zobrist",
"extract": "Benjamin Thomas Zobrist (/ˈzoʊbrɪst/; born May 26, 1981), nicknamed Zorilla, is an American professional baseball second baseman for the Chicago Cubs of Major League Baseball (MLB). He previously played for the Tampa Bay Devil Rays / Rays, his first MLB club and where he spend the majority of his career, and briefly for the Oakland Athletics and Kansas City Royals. A two-time World Series champion in consecutive seasons of 2015 with the Royals and 2016 with Cubs, Zobrist was the 2016 World Series Most Valuable Player.\nA versatile defender and a switch-hitter with a high walk rate, Zobrist has played roughly half his innings at second base, and has also spent significant time at shortstop and in right field. Thus, he has been often been referred to as a \"super utility player\".",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6d/Ben_Zobrist_on_September_9%2C_2015.jpg/320px-Ben_Zobrist_on_September_9%2C_2015.jpg",
"width": 320,
"height": 264
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T05:03:33Z",
"description": "American professional baseball player",
"normalizedtitle": "Ben Zobrist"
}
],
"story": "<!-- Nov 3 -->In baseball, the <a rel=\"mw:WikiLink\" href=\"./2016_Chicago_Cubs_season\" title=\"2016 Chicago Cubs season\" id=\"mwBA\">Chicago Cubs</a> defeat the <a rel=\"mw:WikiLink\" href=\"./2016_Cleveland_Indians_season\" title=\"2016 Cleveland Indians season\" id=\"mwBQ\">Cleveland Indians</a> to win the <b id=\"mwBg\"><a rel=\"mw:WikiLink\" href=\"./2016_World_Series\" title=\"2016 World Series\" id=\"mwBw\">World Series</a></b> for the first time since 1908 <i id=\"mwCA\">(<a rel=\"mw:WikiLink\" href=\"./World_Series_Most_Valuable_Player_Award\" title=\"World Series Most Valuable Player Award\" id=\"mwCQ\">MVP</a> <a rel=\"mw:WikiLink\" href=\"./Ben_Zobrist\" title=\"Ben Zobrist\" id=\"mwCg\">Ben Zobrist</a> pictured)</i>."
},
{
"links": [
{
"title": "Hokkaido_Nippon-Ham_Fighters",
"extract": "The Hokkaido Nippon-Ham Fighters (北海道日本ハムファイターズ, Hokkaidō Nippon-Hamu Faitāzu) are a Japanese professional baseball team based in Sapporo, Hokkaidō. They compete in the Pacific League of Nippon Professional Baseball, playing the majority of their home games at the Sapporo Dome. The Fighters also host a select number of regional home games in cities across Hokkaidō, including Hakodate, Asahikawa, Kushiro, and Obihiro. The team's name comes from its parent organization, Nippon Ham, a major Japanese food processing company.\nFounded in 1946, the Fighters called Tokyo home for 58 years, as co-tenants of the Tokyo Dome with the Central League's Yomiuri Giants near the end of their tenure in the capital city.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/0/01/Nippon_Fighters_insignia.PNG",
"width": 125,
"height": 125
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T07:05:14Z",
"description": "Nippon Professional Baseball team in the Pacific League",
"normalizedtitle": "Hokkaido Nippon-Ham Fighters"
},
{
"title": "Hiroshima_Toyo_Carp",
"extract": "The Hiroshima Toyo Carp (広島東洋カープ, Hiroshima Tōyō Kāpu) are a professional baseball team based in Hiroshima, Japan. They compete in the Central League of Nippon Professional Baseball. The team is primarily owned by the Matsuda family, led by Hajime Matsuda (松田元, Matsuda Hajime), who is a descendant of Mazda founder Jujiro Matsuda. Mazda is the largest single shareholder (34.2%), which is less than the portion owned by the Matsuda family (about 60%). Because of that, Mazda is not considered as the owner firm.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/0/08/Hiroshima_carp_insignia.png",
"width": 125,
"height": 125
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-07T10:09:01Z",
"description": "Nippon Professional Baseball team in the Central League",
"normalizedtitle": "Hiroshima Toyo Carp"
},
{
"title": "2016_Japan_Series",
"extract": "The 2016 Japan Series was the 67th edition of Nippon Professional Baseball's postseason championship series. The Hiroshima Toyo Carp, champions of the Central League, played the Hokkaido Nippon-Ham Fighters, champions of the Pacific League, in a best-of-seven series beginning on October 22. The Japan Series was sponsored by the Sumitomo Mitsui Banking Corporation (SMBC) and was officially known as the 2016 SMBC Nippon Series.\nThe Fighters defeated the Carp in six games. Hiroshima took the first two games, and Hokkaido won the next four games to take the series.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/88/Brad_Eldred_20130317_MAZDA_Zoom-Zoom_Stadium_Hiroshima.JPG/238px-Brad_Eldred_20130317_MAZDA_Zoom-Zoom_Stadium_Hiroshima.JPG",
"width": 238,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-04T10:11:46Z",
"normalizedtitle": "2016 Japan Series"
}
],
"story": "<!--Oct 29--> In baseball, the <a rel=\"mw:WikiLink\" href=\"./Hokkaido_Nippon-Ham_Fighters\" title=\"Hokkaido Nippon-Ham Fighters\" id=\"mwDA\">Hokkaido Nippon-Ham Fighters</a> defeat the <a rel=\"mw:WikiLink\" href=\"./Hiroshima_Toyo_Carp\" title=\"Hiroshima Toyo Carp\" id=\"mwDQ\">Hiroshima Toyo Carp</a> to win the <b id=\"mwDg\"><a rel=\"mw:WikiLink\" href=\"./2016_Japan_Series\" title=\"2016 Japan Series\" id=\"mwDw\">Japan Series</a></b>."
},
{
"links": [
{
"title": "Yazidis",
"extract": "The Yazidis (also Yezidis, Êzidî; /jəˈziːdiːz/ yə-ZEE-dees) are an ethnically Kurdish religious community or an ethno-religious group indigenous to northern Mesopotamia (see also Ezidkhan) who are strictly endogamous. Their religion, Yazidism is linked to ancient Mesopotamian religions and combines aspects of Zoroastrianism, Islam, Christianity and Judaism. Yazidis who marry with non-Yazidis are automatically considered to be converted to the religion of their partner and therefore are not permitted to call themselves Yazidis. They live primarily in the Nineveh Province of Iraq. Additional communities in Armenia, Georgia, Turkey, Iran, and Syria have been in decline since the 1990s as a result of significant migration to Europe, especially to Germany.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/07/Yezidis_of_Jabal.jpg/320px-Yezidis_of_Jabal.jpg",
"width": 320,
"height": 294
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-05T01:33:06Z",
"description": "religious and ethnic minority group of Kurds",
"normalizedtitle": "Yazidis"
},
{
"title": "Nadia_Murad",
"extract": "Nadia Murad Basee Taha (Kurdish: نادیە موراد / Nadiye Murad; born 1993) is a Yazidi human rights activist, Nobel Peace Prize nominee and since September 2016 the first Goodwill Ambassador for the Dignity of Survivors of Human Trafficking of the United Nations. She was kidnapped and held by the Islamic State in August 2014.",
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-03T03:05:31Z",
"description": "Yazidi human rights activist, Nobel Peace Prize nominee and first Goodwill Ambassador for the Dignity of Survivors of Human Trafficking of the United Nations",
"normalizedtitle": "Nadia Murad"
},
{
"title": "Lamiya_Aji_Bashar",
"extract": "Lamiya Aji Bashar (Kurdish: لمياء حجي بشار) is a Yazidi human rights activist. She was awarded the Sakharov Prize jointly with Nadia Murad in 2016.",
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-05T20:27:55Z",
"normalizedtitle": "Lamiya Aji Bashar"
},
{
"title": "Sakharov_Prize",
"extract": "The Sakharov Prize for Freedom of Thought, commonly known as the Sakharov Prize, honours individuals and groups of people who have dedicated their lives to the defense of human rights and freedom of thought. Named after Russian scientist and dissident Andrei Sakharov, the prize was established in December 1988 by the European Parliament. A shortlist of nominees is drawn up by the Committee on Foreign Affairs and the Committee on Development, with the winner announced in October. The prize is accompanied by a monetary award of €50,000.\nThe first prize was awarded jointly to South African Nelson Mandela and Russian Anatoly Marchenko.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f0/Remise_du_Prix_Sakharov_%C3%A0_Aung_San_Suu_Kyi_Strasbourg_22_octobre_2013-21.jpg/320px-Remise_du_Prix_Sakharov_%C3%A0_Aung_San_Suu_Kyi_Strasbourg_22_octobre_2013-21.jpg",
"width": 320,
"height": 213
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-04T13:22:10Z",
"description": "award",
"normalizedtitle": "Sakharov Prize"
}
],
"story": "<!--Oct 27--> <a rel=\"mw:WikiLink\" href=\"./Yazidis\" title=\"Yazidis\" id=\"mwEQ\">Yazidi</a> human rights activists <a rel=\"mw:WikiLink\" href=\"./Nadia_Murad\" title=\"Nadia Murad\" id=\"mwEg\">Nadia Murad</a> and <a rel=\"mw:WikiLink\" href=\"./Lamiya_Aji_Bashar\" title=\"Lamiya Aji Bashar\" id=\"mwEw\">Lamiya Aji Bashar</a> win the <b id=\"mwFA\"><a rel=\"mw:WikiLink\" href=\"./Sakharov_Prize\" title=\"Sakharov Prize\" id=\"mwFQ\">Sakharov Prize</a></b>."
},
{
"links": [
{
"title": "2016_Quetta_police_training_college_attack",
"extract": "On 24 October 2016, three heavily armed terrorists carried out an attack on the Balochistan police training college in Quetta, Pakistan, killing 61 cadets and injuring more than 165 others. The Islamic State of Iraq and the Levant Khorasan Province claimed responsibility for the attack, and Pakistan-based Lashkar-e-Jhangvi claimed to have collaborated with them. According to Pakistani authorities, the assailants came from Afghanistan and were in contact with their handlers there while perpetrating the attack.",
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-06T23:35:03Z",
"normalizedtitle": "2016 Quetta police training college attack"
},
{
"title": "Quetta",
"extract": "Quetta (Urdu: کوئٹہ‎, Pashto: کوټه‎, Balochi: کویته pronunciation ) is the provincial capital of Balochistan, Pakistan and the ninth-largest city of Pakistan. The city is known as the fruit garden of Pakistan, due to the numerous fruit orchards in and around it, and the large variety of fruits and dry fruits produced there. The city was also known as Little Paris in the past due to its beauty and geographical location. The immediate area has long been one of pastures and mountains, with varied plants and animals relative to the dry plains to the west. Quetta is at an average elevation of 1,680 meters (5,510 feet) above sea level, making it Pakistan's only high-altitude major city.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Jinnah_Road%2C_Quetta.JPG/320px-Jinnah_Road%2C_Quetta.JPG",
"width": 320,
"height": 211
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-05T22:02:45Z",
"description": "city in Pakistan",
"normalizedtitle": "Quetta"
}
],
"story": "<!--Oct 24--> More than 60<span typeof=\"mw:Entity\" id=\"mwFw\">&nbsp;</span>people are killed in <b id=\"mwGA\"><a rel=\"mw:WikiLink\" href=\"./2016_Quetta_police_training_college_attack\" title=\"2016 Quetta police training college attack\" id=\"mwGQ\">an attack</a></b> on a police training centre in <a rel=\"mw:WikiLink\" href=\"./Quetta\" title=\"Quetta\" id=\"mwGg\">Quetta</a>, Pakistan."
},
{
"links": [
{
"title": "2016_Eséka_train_derailment",
"extract": "On 21 October 2016, a Camrail inter-city passenger train travelling from Cameroon's capital Yaoundé to its largest city Douala derailed in Eséka, Centre Region. By 30 October 2016, the official number of casualties had reached 79 dead, with 550 injured.\nIt was the deadliest rail accident on the African continent since the August 2007 Benaleka train accident.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/5/54/Cameroon_physical_map.svg/222px-Cameroon_physical_map.svg.png",
"width": 222,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-06T20:46:01Z",
"description": "train derailment in Cameroon",
"normalizedtitle": "2016 Eséka train derailment"
},
{
"title": "Cameroon",
"extract": "Cameroon (/ˌkæməˈruːn/; French: Cameroun), officially the Republic of Cameroon (French: République du Cameroun), is a country in Central Africa . It is bordered by Nigeria to the west; Chad to the northeast; the Central African Republic to the east; and Equatorial Guinea, Gabon, and the Republic of the Congo to the south. Cameroon's coastline lies on the Bight of Bonny, part of the Gulf of Guinea and the Atlantic Ocean.\nCameroon is home to more than 1738 different linguistic groups. French and English are the official languages.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4f/Flag_of_Cameroon.svg/320px-Flag_of_Cameroon.svg.png",
"width": 320,
"height": 213
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-03T00:25:57Z",
"description": "country in Africa",
"normalizedtitle": "Cameroon"
}
],
"story": "<!--Oct 22--> At least 70<span typeof=\"mw:Entity\" id=\"mwHA\">&nbsp;</span>people are killed and around 600 others injured in <b id=\"mwHQ\"><a rel=\"mw:WikiLink\" href=\"./2016_Eséka_train_derailment\" title=\"2016 Eséka train derailment\" id=\"mwHg\">a train derailment</a></b> in <a rel=\"mw:WikiLink\" href=\"./Cameroon\" title=\"Cameroon\" id=\"mwHw\">Cameroon</a>."
}
]

View file

@ -0,0 +1,27 @@
{
"wiki": "wikidatawiki",
"id": "100609428",
"type": "reverted",
"category": "reverted",
"timestamp": {
"utciso8601": "2017-01-05T17:10:56Z",
"utcunix": "1483636256",
"unix": "1483636256",
"utcmw": "20170105171056",
"mw": "20170105171056",
"date": "Today"
},
"title": {
"full": "Q1140626",
"namespace": "",
"namespace-key": 0,
"text": "Q1140626"
},
"agent": {
"id": 0,
"name": "User1"
},
"revid": 424546621,
"read": "20170105172611",
"targetpages": []
}

View file

@ -0,0 +1,64 @@
{
"batchcomplete": true,
"query": {
"notifications": {
"list": [
{
"wiki": "enwiki",
"id": "87425134",
"type": "edit-thank",
"category": "edit-thank",
"timestamp": {
"utciso8601": "2016-09-07T18:16:25Z",
"utcunix": "1473272185",
"unix": "1473272185",
"utcmw": "20160907181625",
"mw": "20160907141625",
"date": "7 September"
},
"title": {
"full": "PageTitle",
"namespace": "User",
"namespace-key": 2,
"text": "PageTitle"
},
"agent": {
"id": 19707259,
"name": "User1"
},
"revid": 738229987,
"read": "20170105211531",
"targetpages": []
},
{
"wiki": "wikidatawiki",
"id": "100609428",
"type": "reverted",
"category": "reverted",
"timestamp": {
"utciso8601": "2017-01-05T17:10:56Z",
"utcunix": "1483636256",
"unix": "1483636256",
"utcmw": "20170105171056",
"mw": "20170105171056",
"date": "Today"
},
"title": {
"full": "Q1140626",
"namespace": "",
"namespace-key": 0,
"text": "Q1140626"
},
"agent": {
"id": 0,
"name": "User2"
},
"revid": 424546621,
"read": "20170105172611",
"targetpages": []
}
],
"continue": null
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,308 @@
{
"batchcomplete": true,
"continue": {
"sroffset": 1,
"gpsoffset": 20,
"continue": "gpsoffset||"
},
"query": {
"redirects": [
{
"index": 1,
"from": "Abama",
"to": "Narthecium"
},
{
"index": 2,
"from": "Abamax",
"to": "Amitriptyline"
}
],
"pages": [
{
"pageid": 1934,
"ns": 0,
"title": "Abadan, Iran",
"index": 6,
"terms": {
"description": [
"city in Iran",
"city in Iran",
"city in Iran"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/eb/Abadan_Catalitic_facilities.jpg/314px-Abadan_Catalitic_facilities.jpg",
"width": 314,
"height": 320
}
},
{
"pageid": 2473,
"ns": 0,
"title": "Abacá",
"index": 8,
"terms": {
"description": [
"species of plant"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Musa_textilis_-_Manila_Hemp_-_desc-flower.jpg/320px-Musa_textilis_-_Manila_Hemp_-_desc-flower.jpg",
"width": 320,
"height": 240
}
},
{
"pageid": 2477,
"ns": 0,
"title": "Abakan",
"index": 9,
"terms": {
"description": [
"city in Russia, capital of the Republic of Khakassia"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Wallpaper_meria.jpg/320px-Wallpaper_meria.jpg",
"width": 320,
"height": 240
}
},
{
"pageid": 293833,
"ns": 0,
"title": "Abaza language",
"index": 19,
"terms": {
"description": [
"language of the Caucasus mountains in the Russian KarachayCherkess Republic by the Abazins"
]
}
},
{
"pageid": 492154,
"ns": 0,
"title": "Abaiang",
"index": 16,
"terms": {
"description": [
"atoll"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/04_Map_of_Abaiang%2C_Kiribati.jpg/247px-04_Map_of_Abaiang%2C_Kiribati.jpg",
"width": 247,
"height": 320
}
},
{
"pageid": 583678,
"ns": 0,
"title": "Amitriptyline",
"index": 2,
"terms": {
"description": [
"chemical compound",
"chemical compound"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/68/Amitriptyline2DACS.svg/318px-Amitriptyline2DACS.svg.png",
"width": 318,
"height": 320
}
},
{
"pageid": 770058,
"ns": 0,
"title": "Abacavir",
"index": 7,
"terms": {
"description": [
"chemical compound"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/Abacavir.svg/320px-Abacavir.svg.png",
"width": 320,
"height": 253
}
},
{
"pageid": 951345,
"ns": 0,
"title": "Abamectin",
"index": 20,
"terms": {
"description": [
"avermectin"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Avermectins.png/320px-Avermectins.png",
"width": 320,
"height": 206
}
},
{
"pageid": 975842,
"ns": 0,
"title": "Abaqa Khan",
"index": 17,
"terms": {
"description": [
"Mongol ruler of Persia",
"Mongol ruler of Persia"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/21/AbaqaOnHorseArghunStandingGhazanAsAChild.jpg/320px-AbaqaOnHorseArghunStandingGhazanAsAChild.jpg",
"width": 320,
"height": 204
}
},
{
"pageid": 990183,
"ns": 0,
"title": "Abaya",
"index": 18,
"terms": {
"description": [
"Female dress"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Islamic_Clothing_Abaya.jpg/147px-Islamic_Clothing_Abaya.jpg",
"width": 147,
"height": 320
}
},
{
"pageid": 1089694,
"ns": 0,
"title": "Abacab",
"index": 11,
"terms": {
"description": [
"album"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/en/2/2c/Abacab.jpg",
"width": 314,
"height": 316
}
},
{
"pageid": 1142711,
"ns": 0,
"title": "Aba, Abia",
"index": 14,
"terms": {
"description": [
"city in Abia State, southern Nigeria"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/12/Aba_Nigeria_hotel.jpg/320px-Aba_Nigeria_hotel.jpg",
"width": 320,
"height": 213
}
},
{
"pageid": 2060913,
"ns": 0,
"title": "Narthecium",
"index": 1,
"terms": {
"description": [
"genus of plants"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Narthecium_ossifragum_01.jpg/240px-Narthecium_ossifragum_01.jpg",
"width": 240,
"height": 320
}
},
{
"pageid": 5982795,
"ns": 0,
"title": "ABA All-Time Team",
"index": 13
},
{
"pageid": 9267310,
"ns": 0,
"title": "Abarangers",
"index": 10,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/en/thumb/d/da/Abaranger.jpg/320px-Abaranger.jpg",
"width": 320,
"height": 240
}
},
{
"pageid": 9514706,
"ns": 0,
"title": "Abatacept",
"index": 12,
"terms": {
"description": [
"pharmaceutical drug"
]
}
},
{
"pageid": 13777854,
"ns": 0,
"title": "Abama Open de Canarias",
"index": 3
},
{
"pageid": 22922593,
"ns": 0,
"title": "ABADÁ-Capoeira",
"index": 5
},
{
"pageid": 35995057,
"ns": 0,
"title": "Aba Mansuri",
"index": 4,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/be/Iran_location_map.svg/320px-Iran_location_map.svg.png",
"width": 320,
"height": 286
}
},
{
"pageid": 44057826,
"ns": 0,
"title": "Abacavir/dolutegravir/lamivudine",
"index": 15,
"terms": {
"description": [
"drug combination for HIV"
]
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/85/Abacavir%2C_dolutegravir_and_lamivudine.svg/200px-Abacavir%2C_dolutegravir_and_lamivudine.svg.png",
"width": 200,
"height": 320
}
}
],
"searchinfo": {
"suggestion": "ababa",
"suggestionsnippet": "<em>ababa</em>"
},
"search": [
{
"ns": 0,
"title": "Abama Open de Canarias"
}
]
}
}

View file

@ -0,0 +1,6 @@
{
"batchcomplete": true,
"query": {
"search": []
}
}

View file

@ -0,0 +1,12 @@
{
"extract": "Barack Hussein Obama II (US /bəˈrɑːk huːˈseɪn oʊˈbɑːmə/; born August 4, 1961) is an American politician who is the 44th and current President of the United States. He is the first African American to hold the office and the first president born outside the continental United States. Born in Honolulu, Hawaii, Obama is a graduate of Columbia University and Harvard Law School, where he was president of the Harvard Law Review. He was a community organizer in Chicago before earning his law degree. He worked as a civil rights attorney and taught constitutional law at the University of Chicago Law School between 1992 and 2004.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/8d/President_Barack_Obama.jpg/256px-President_Barack_Obama.jpg",
"width": 256,
"height": 320
},
"lang": "en",
"dir": "ltr",
"timestamp": "2016-11-01T15:48:15Z",
"description": "44th President of the United States of America"
}

View file

@ -0,0 +1,52 @@
{
"type": "standard",
"title": "Fermat's Last Theorem",
"displaytitle": "Fermat's Last Theorem",
"namespace": {
"id": 0,
"text": ""
},
"titles": {
"canonical": "Fermat's_Last_Theorem",
"normalized": "Fermat's Last Theorem",
"display": "Fermat's Last Theorem"
},
"pageid": 19021953,
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/Diophantus-II-8-Fermat.jpg/203px-Diophantus-II-8-Fermat.jpg",
"width": 203,
"height": 320
},
"originalimage": {
"source": "https://upload.wikimedia.org/wikipedia/commons/4/47/Diophantus-II-8-Fermat.jpg",
"width": 914,
"height": 1440
},
"lang": "en",
"dir": "ltr",
"revision": "832091465",
"tid": "f6d6f80c-2ed3-11e8-a436-b2755950c3e1",
"timestamp": "2018-03-23T19:54:06Z",
"description": "theorem in number theory",
"extract": "In number theory, Fermat's Last Theorem states that no three positive integers a, b, and c satisfy the equation an + bn = cn for any integer value of n greater than 2. The cases n = 1 and n = 2 have been known to have infinitely many solutions since antiquity.",
"extract_html": "<p>In number theory, <b>Fermat's Last Theorem</b> states that no three positive integers <span class=\"texhtml \"><i>a</i></span>, <span class=\"texhtml \"><i>b</i></span>, and <span class=\"texhtml \"><i>c</i></span> satisfy the equation <span class=\"texhtml \"><i>a</i><sup><i>n</i></sup> + <i>b</i><sup><i>n</i></sup> = <i>c</i><sup><i>n</i></sup></span> for any integer value of <span class=\"texhtml \"><i>n</i></span> greater than 2. The cases <span class=\"texhtml \"><i>n</i> = 1</span> and <span class=\"texhtml \"><i>n</i> = 2</span> have been known to have infinitely many solutions since antiquity.</p>",
"content_urls": {
"desktop": {
"page": "https://en.wikipedia.org/wiki/Fermat's_Last_Theorem",
"revisions": "https://en.wikipedia.org/wiki/Fermat's_Last_Theorem?action=history",
"edit": "https://en.wikipedia.org/wiki/Fermat's_Last_Theorem?action=edit",
"talk": "https://en.wikipedia.org/wiki/Talk:Fermat's_Last_Theorem"
},
"mobile": {
"page": "https://en.m.wikipedia.org/wiki/Fermat's_Last_Theorem",
"revisions": "https://en.m.wikipedia.org/wiki/Special:History/Fermat's_Last_Theorem",
"edit": "https://en.m.wikipedia.org/wiki/Fermat's_Last_Theorem?action=edit",
"talk": "https://en.m.wikipedia.org/wiki/Talk:Fermat's_Last_Theorem"
}
},
"api_urls": {
"summary": "https://en.wikipedia.org/api/rest_v1/page/summary/Fermat's_Last_Theorem",
"edit_html": "https://en.wikipedia.org/api/rest_v1/page/html/Fermat's_Last_Theorem",
"talk_page_html": "https://en.wikipedia.org/api/rest_v1/page/html/Talk:Fermat's_Last_Theorem"
}
}

View file

@ -0,0 +1,43 @@
{
"batchcomplete": true,
"query": {
"normalized": [
{
"fromencoded": false,
"from": "Barack_Obama",
"to": "Barack Obama"
},
{
"fromencoded": false,
"from": "Joe_Biden",
"to": "Joe Biden"
}
],
"pages": [
{
"pageid": 145422,
"ns": 0,
"title": "Joe Biden",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Official_portrait_of_Vice_President_Joe_Biden.jpg/255px-Official_portrait_of_Vice_President_Joe_Biden.jpg",
"width": 255,
"height": 320
},
"description": "47th Vice President of the United States",
"descriptionsource": "local"
},
{
"pageid": 534366,
"ns": 0,
"title": "Barack Obama",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/8d/President_Barack_Obama.jpg/256px-President_Barack_Obama.jpg",
"width": 256,
"height": 320
},
"description": "44th President of the United States of America",
"descriptionsource": "central"
}
]
}
}

View file

@ -0,0 +1,177 @@
{
"pages": [{
"pageid": 33702,
"ns": 0,
"index": 19,
"type": "standard",
"title": "Wolf",
"displaytitle": "Wolf",
"namespace": {
"id": 0,
"text": ""
},
"titles": {
"canonical": "Wolf",
"normalized": "Wolf",
"display": "Wolf"
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/ab/European_grey_wolf_in_Prague_zoo.jpg/291px-European_grey_wolf_in_Prague_zoo.jpg",
"width": 291,
"height": 320
},
"originalimage": {
"source": "https://upload.wikimedia.org/wikipedia/commons/a/ab/European_grey_wolf_in_Prague_zoo.jpg",
"width": 1412,
"height": 1552
},
"lang": "en",
"dir": "ltr",
"revision": "855281275",
"tid": "ce283516-a5f5-11e8-ab3b-ccb113296fc7",
"timestamp": "2018-08-17T05:26:48Z",
"description": "species of mammal",
"extract": "The wolf, also known as the gray wolf, timber wolf, western wolf, and its other subspecies is a canine native to the wilderness and remote areas of Eurasia and North America. It is the largest extant member of its family, with males averaging 4345 kg (9599 lb) and females 3638.5 kg (7985 lb). Like the red wolf, it is distinguished from other Canis species by its larger size and less pointed features, particularly on the ears and muzzle. Its winter fur is long and bushy and predominantly a mottled gray in color, although nearly pure white, red, and brown to black also occur. Mammal Species of the World, a standard reference work in zoology, recognises 38 subspecies of C. lupus..",
"extract_html": "<p>The <b>wolf</b>, also known as the <b>gray wolf</b>, <b>timber wolf</b>, <b>western wolf</b>, and its other subspecies is a canine native to the wilderness and remote areas of Eurasia and North America. It is the largest extant member of its family, with males averaging 4345 kg (9599 lb) and females 3638.5 kg (7985 lb). Like the red wolf, it is distinguished from other <i>Canis</i> species by its larger size and less pointed features, particularly on the ears and muzzle. Its winter fur is long and bushy and predominantly a mottled gray in color, although nearly pure white, red, and brown to black also occur. <i>Mammal Species of the World</i>, a standard reference work in zoology, recognises 38 subspecies of <i>C. lupus</i>..</p>",
"normalizedtitle": "Wolf"
}, {
"pageid": 62893,
"ns": 0,
"index": 6,
"type": "standard",
"title": "Dingo",
"displaytitle": "Dingo",
"namespace": {
"id": 0,
"text": ""
},
"titles": {
"canonical": "Dingo",
"normalized": "Dingo",
"display": "Dingo"
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/98/Dingo_walking.jpg/320px-Dingo_walking.jpg",
"width": 320,
"height": 170
},
"originalimage": {
"source": "https://upload.wikimedia.org/wikipedia/commons/9/98/Dingo_walking.jpg",
"width": 487,
"height": 259
},
"lang": "en",
"dir": "ltr",
"revision": "855391560",
"tid": "19bf86da-a611-11e8-81e0-df69a20262cf",
"timestamp": "2018-08-17T23:30:55Z",
"description": "Canis lupus australian",
"extract": "The dingo is a type of feral dog native to Australia. Its taxonomic status is debated. The first British colonists to arrive established a settlement at Port Jackson in 1788 and recorded dingoes living there with indigenous Australians. Although the dingo exists in the wild, it associates with humans but has not been selectively bred as have other domesticated animals. It is a medium-sized canid that possesses a lean, hardy body adapted for speed, agility and stamina. The dingo's three main coat colours are described as being either light ginger, black and tan, or creamy white. The head is the widest part of the dingo, is wedge-shaped, and large in proportion to the body. The dingo skull differs to that of the domestic dog by its larger palatal width, longer rostrum, shorter skull height, and wider sagittal crest. One can regard the dingo as an ecotype or an ecospecies which has adapted to Australia's unique environment. It is listed as a \"vulnerable species\" on the IUCN Red List due to declining numbers caused by hybridization with the domestic dog.",
"extract_html": "<p>The <b>dingo</b> is a type of feral dog native to Australia. Its taxonomic status is debated. The first British colonists to arrive established a settlement at Port Jackson in 1788 and recorded dingoes living there with indigenous Australians. Although the dingo exists in the wild, it associates with humans but has not been selectively bred as have other domesticated animals. It is a medium-sized canid that possesses a lean, hardy body adapted for speed, agility and stamina. The dingo's three main coat colours are described as being either light ginger, black and tan, or creamy white. The head is the widest part of the dingo, is wedge-shaped, and large in proportion to the body. The dingo skull differs to that of the domestic dog by its larger palatal width, longer rostrum, shorter skull height, and wider sagittal crest. One can regard the dingo as an ecotype or an ecospecies which has adapted to Australia's unique environment. It is listed as a &quot;vulnerable species&quot; on the IUCN Red List due to declining numbers caused by hybridization with the domestic dog.</p>",
"normalizedtitle": "Dingo"
}, {
"pageid": 403300,
"ns": 0,
"index": 16,
"type": "standard",
"title": "Canis",
"displaytitle": "<i>Canis</i>",
"namespace": {
"id": 0,
"text": ""
},
"titles": {
"canonical": "Canis",
"normalized": "Canis",
"display": "<i>Canis</i>"
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Canis.jpg/223px-Canis.jpg",
"width": 223,
"height": 320
},
"originalimage": {
"source": "https://upload.wikimedia.org/wikipedia/commons/3/3f/Canis.jpg",
"width": 2800,
"height": 4024
},
"lang": "en",
"dir": "ltr",
"revision": "855521281",
"tid": "7972f3ca-a501-11e8-b794-b18962a72806",
"timestamp": "2018-08-18T22:46:37Z",
"description": "genus of mammals",
"extract": "Canis is a genus of the Canidae containing multiple extant species, such as wolves, coyotes, jackals, dingoes, and dogs. Species of this genus are distinguished by their moderate to large size, their massive, well-developed skulls and dentition, long legs, and comparatively short ears and tails.",
"extract_html": "<p><i><b>Canis</b></i> is a genus of the Canidae containing multiple extant species, such as wolves, coyotes, jackals, dingoes, and dogs. Species of this genus are distinguished by their moderate to large size, their massive, well-developed skulls and dentition, long legs, and comparatively short ears and tails.</p>",
"normalizedtitle": "Canis"
}, {
"pageid": 441452,
"ns": 0,
"index": 17,
"type": "standard",
"title": "Saarloos_wolfdog",
"displaytitle": "Saarloos wolfdog",
"namespace": {
"id": 0,
"text": ""
},
"titles": {
"canonical": "Saarloos_wolfdog",
"normalized": "Saarloos wolfdog",
"display": "Saarloos wolfdog"
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/7e/Bow_bow.jpg/213px-Bow_bow.jpg",
"width": 213,
"height": 320
},
"originalimage": {
"source": "https://upload.wikimedia.org/wikipedia/commons/7/7e/Bow_bow.jpg",
"width": 1027,
"height": 1540
},
"lang": "en",
"dir": "ltr",
"revision": "855253783",
"tid": "ba12af02-a540-11e8-85b2-4f2120e71031",
"timestamp": "2018-08-17T00:14:47Z",
"description": "dog breed, canid hybrid",
"extract": "The Saarloos wolfdog or Saarloos wolfhound is an established breed of dog originating from wolfdog hybrid crosses.",
"extract_html": "<p>The <b>Saarloos wolfdog</b> or <b>Saarloos wolfhound</b> is an established breed of dog originating from wolfdog hybrid crosses.</p>",
"normalizedtitle": "Saarloos wolfdog"
}, {
"pageid": 968202,
"ns": 0,
"index": 10,
"type": "standard",
"title": "Dog_intelligence",
"displaytitle": "Dog intelligence",
"namespace": {
"id": 0,
"text": ""
},
"titles": {
"canonical": "Dog_intelligence",
"normalized": "Dog intelligence",
"display": "Dog intelligence"
},
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/8e/Vizsla_r%C3%A1h%C3%BAz_a_vadra.jpg/320px-Vizsla_r%C3%A1h%C3%BAz_a_vadra.jpg",
"width": 320,
"height": 214
},
"originalimage": {
"source": "https://upload.wikimedia.org/wikipedia/commons/8/8e/Vizsla_r%C3%A1h%C3%BAz_a_vadra.jpg",
"width": 640,
"height": 427
},
"lang": "en",
"dir": "ltr",
"revision": "851689587",
"tid": "aa4f0e1e-a401-11e8-8cf9-20bf79246778",
"timestamp": "2018-07-23T23:36:35Z",
"extract": "Dog intelligence or dog cognition is the process in dogs of acquiring, storing in memory, retrieving, combining, comparing, and using in new situations information and conceptual skills.",
"extract_html": "<p><b>Dog intelligence</b> or <b>dog cognition</b> is the process in dogs of acquiring, storing in memory, retrieving, combining, comparing, and using in new situations information and conceptual skills.</p>",
"normalizedtitle": "Dog intelligence"
}]
}

View file

@ -0,0 +1,19 @@
{
"batchcomplete": true,
"query": {
"users": [
{
"userid": 24531888,
"name": "USER",
"implicitgroups": [
"*",
"user"
]
}
],
"userinfo": {
"id": 24531888,
"name": "USER"
}
}
}

View file

@ -0,0 +1,9 @@
{
"batchcomplete": true,
"query": {
"userinfo": {
"id": 24531888,
"name": "MHolloway (WMF)"
}
}
}

Some files were not shown because too many files have changed in this diff Show more