title: Keep getting error: "Failed with: Uncaught SyntaxError: Unexpected token T in <unknown file>:1" (PARSE CLOUD CODE)
body: <p>If someone could help me with this it would be a life saver!!</p>
  
  <p>(I'm using PARSE)</p>
  
  <p>Basically what this parse job attempts to do is
  1) queries all objects of a class called channel 
  2) loop through each object in the "Results" array which is returned from the query 
  3) make a call to a Google API which returns a JSON string 
  4) parse the JSON and save new instances of an Object called Videos </p>
  
  <p>The problem is i keep getting the errors:
  Failed with: Uncaught SyntaxError: Unexpected token T in :1
  Failed with: Uncaught SyntaxError: Unexpected end of input in :0</p>
  
  <pre><code>Parse.Cloud.job("TestFunction", function(request, status) {
  
  var query = new Parse.Query("Channel");
  query.find ({
      success: function (results) {
  
  
          var httpRaw;
  
          for (var i = 0; i &lt; results.length; i++) {
  
              var channel_id = results[i].get("channel_id");
  
              Parse.Cloud.httpRequest({
                  url: 'https://www.googleapis.com/youtube/v3/search?part=snippet&amp;channelId=UCKy1dAqELo0zrOtPkf0eTMw&amp;maxResults=50&amp;order=viewCount&amp;type=video&amp;key=AIzaSyCLGCJOPU8VVj7daoh5HwXZASnmGoc4ylo',
                  success: function (httpResponse) {
  
                      httpRaw = httpResponse.text;
  
                  },
                  error: function (httpResponse) {
                      console.error('Request failed with response code ' + httpResponse.status);
  
                  }
  
              });
  
  
              var json = JSON.parse(httpRaw);
  
              for (var z = 0; z &lt; json.items.length ; z++){
  
                  var video = new Parse.Object("Video");
                  video.set("video_id", json.items[z].id.videoId.toString());
                  video.set("video_title", json.items[z].snippet.title.toString());
                  video.set("video_description", json.items[z].snippet.description.toString());
                  video.set("video_thumbnail", json.items[z].snippet.thumbnails.medium.url.toString());
                  video.set("date_published", json.items[z].snippet.publishedAt.toString());
  
                  var relation = video.relation("parent_channel");
                  relation.add(results[i]);
                  video.save();
              }
  
  
          }
  
      },
      error: function() {
  
      }
  });
  </code></pre>
  
  <p>});</p>