<commit_before>package cs263;

import java.io.IOException;
import java.util.Date;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;

// The Worker servlet should be mapped to the "/worker" URL.
public class Worker extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        String title = request.getParameter("title");
        String year = request.getParameter("year");
        String director = request.getParameter("director");
        String genre = request.getParameter("genre");
        String plot = request.getParameter("plot");
        String rating = request.getParameter("rating");
        String poster_url = request.getParameter("poster");
        		
        System.out.println(title);
        System.out.println(year);
        System.out.println(director);
        System.out.println(rating);
        System.out.println(poster_url);
        
        //TODO Convert json_data to GSON object

        Key movieKey = KeyFactory.createKey("Movie", title);
        Entity movie = new Entity("Movies", movieKey);
        movie.setProperty("title", title);
        movie.setProperty("year", year);
        movie.setProperty("director", director);
        movie.setProperty("genre", genre);
        movie.setProperty("plot", plot);
        movie.setProperty("rating", rating);
        movie.setProperty("poster", poster_url);

        DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
        datastore.put(movie);
    }
}
<commit_msg>Add Date to movie information<commit_after>package cs263;

import java.io.IOException;
import java.util.Date;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;

// The Worker servlet should be mapped to the "/worker" URL.
public class Worker extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        String title = request.getParameter("title");
        String year = request.getParameter("year");
        String director = request.getParameter("director");
        String genre = request.getParameter("genre");
        String plot = request.getParameter("plot");
        String rating = request.getParameter("rating");
        String poster_url = request.getParameter("poster");
  
        
        Date date = new Date();

        Key movieKey = KeyFactory.createKey("Movie", title);
        Entity movie = new Entity("Movie", movieKey);
        movie.setProperty("date", date);
        movie.setProperty("title", title);
        movie.setProperty("year", year);
        movie.setProperty("director", director);
        movie.setProperty("genre", genre);
        movie.setProperty("plot", plot);
        movie.setProperty("rating", rating);
        movie.setProperty("poster", poster_url);

        DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
        datastore.put(movie);
    }
}

{'fraction_non_alphanumeric': 0.11061364234922307, 'fraction_numerical': 0.0015801948907031868, 'mean_word_length': 3.6544117647058822, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4368606', 'n_tokens_mistral': 1026, 'n_tokens_neox': 1013, 'n_words': 213}