/interest

👀 Interest: Organizing papers+materials which you are interested in. Serverless application powered by GitHub pages + Google Spreadsheet.

Primary LanguageTypeScript

Interest

Paper management system built on GitHub Pages and Google {Forms, Sheets, Apps Script}.

Adding items

Form

You can add a paper with Google Form.

Spreadsheet

You can view added papers on Google Spreadsheet.

API to get papers

Interest uses Google Apps Script to build API to get papers from a spreadsheet.

var schema = {
  timeStamp: 0,
  title: 3,
  authors: 2,
  isRead: 1,
  sourceShort: 4,
  year: 5,
  paperLink: 6,
  keywords: 8,
  note: 7,
  paperType: 10,
  issueLink: 11,
  source: 12,
};


function toDict (row) {
  var item = {}
  for (var key in schema) item[key] = row[schema[key]];
  return item;
};


function fetchPapers() {
  var paperListSpreadSheet = SpreadsheetApp.
  openById("your_spreadsheet_id").
  getSheetByName("Form Responses 1");
  
  var paperList = paperListSpreadSheet.getDataRange().getValues().map(function(row, index) {
    if (index == 0) return;  // header
    return toDict(row);
  }).filter(function(ret) { return ret != null} );
  
  Logger.log(paperList);
  return JSON.stringify(paperList);
}


function doGet() {
  const paperListJson = fetchPapers();
  return ContentService.createTextOutput(paperListJson);
}

Blog article