apps-android-wikipedia icon indicating copy to clipboard operation
apps-android-wikipedia copied to clipboard

Support exporting history to csv

Open azeemba opened this issue 3 years ago • 2 comments

On the "Search" section, the application shows the history of the pages the user has viewed. The history view supports filtering and deleting.

In this commit, we add a new option to "export" the history via a csv file. The CSV file contains all the data from the history table. After the file is created, the user is prompted on how they want to share the file.

Bug: T249340

azeemba avatar Oct 09 '22 21:10 azeemba

Hi @azeemba Thank you for working on this. We experimented a bit with csv on another similar export feature, and found it much more suitable to use json instead. Could you please adjust that in the PR, and export as json instead? This would make writing the objects easier as well. Thank you, Sharvani

sharvaniharan avatar Oct 31 '22 18:10 sharvaniharan

Sorry for the delay here. Here is a demo video:

https://user-images.githubusercontent.com/2160795/206884873-a197224b-106e-44cb-a1d7-ab1e41b49873.mp4

Here is what the content of the file looks like (after running a JSON prettifier on the data)

[
  {
    "authority": "en.wikipedia.org",
    "lang": "en",
    "apiTitle": "Maria_Thaddäus_von_Trautmannsdorff",
    "displayTitle": "<span class=\"mw-page-title-main\">Maria Thaddäus von Trautmannsdorff</span>",
    "id": 2,
    "timestamp": 1670728311564,
    "source": 13,
    "timeSpentSec": 631
  },
  {
    "authority": "en.wikipedia.org",
    "lang": "en",
    "apiTitle": "Cristiano_Ronaldo",
    "displayTitle": "<span class=\"mw-page-title-main\">Cristiano Ronaldo</span>",
    "id": 9,
    "timestamp": 1670728305715,
    "source": 14,
    "timeSpentSec": 1
  },
  {
    "authority": "en.wikipedia.org",
    "lang": "en",
    "apiTitle": "FIFA_World_Cup",
    "displayTitle": "<span class=\"mw-page-title-main\">FIFA World Cup</span>",
    "id": 8,
    "timestamp": 1670728299343,
    "source": 14,
    "timeSpentSec": 2
  },
  {
    "authority": "en.wikipedia.org",
    "lang": "en",
    "apiTitle": "2022_FIFA_World_Cup",
    "displayTitle": "<span class=\"mw-page-title-main\">2022 FIFA World Cup</span>",
    "id": 7,
    "timestamp": 1670728281733,
    "source": 14,
    "timeSpentSec": 3
  }
]

azeemba avatar Dec 11 '22 03:12 azeemba

Cleaning up old PRs. For the moment we do not plan on including this functionality in our releases. Please feel free to use this in your own fork(s).

dbrant avatar Apr 23 '24 13:04 dbrant