Add some logging
This commit is contained in:
parent
6c00e63d1f
commit
e8893fd712
|
@ -1,6 +1,7 @@
|
|||
package com.akdev.nofbeventscraper;
|
||||
|
||||
import android.os.AsyncTask;
|
||||
import android.util.Log;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
@ -143,6 +144,8 @@ public class FbEventScraper extends AsyncTask<Void, Void, Void> {
|
|||
@Override
|
||||
protected Void doInBackground(Void... voids) {
|
||||
|
||||
Log.d("scraperLog", "doInBackground: "+url);
|
||||
|
||||
Document document = DocumentReceiver.getDocument(url);
|
||||
|
||||
try {
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.akdev.nofbeventscraper;
|
|||
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.AsyncTask;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
|
@ -165,6 +166,7 @@ public class FbScraper {
|
|||
void scrapeEventResultCallback(FbEvent event, int error) {
|
||||
|
||||
if (event != null) {
|
||||
Log.d("scraperLog", "scrapeEventResultCallback: "+event.url);
|
||||
main.get().addEvent(event);
|
||||
main.get().input_helper(main.get().getString(R.string.done), false);
|
||||
} else if (url_type == url_type_enum.EVENT) {
|
||||
|
@ -193,10 +195,11 @@ public class FbScraper {
|
|||
protected void scrapePageResultCallback(List<String> event_urls, int error) {
|
||||
|
||||
if (event_urls.size() > 0) {
|
||||
|
||||
Log.d("scraperLog", "scrapePageResultCallback: "+event_urls.toString());
|
||||
for (String event_url : event_urls) {
|
||||
try {
|
||||
String url = getEventUrl(event_url);
|
||||
Log.d("scraperLog", "scrapePageResultCallback: "+url);
|
||||
scrapeEvent(url);
|
||||
} catch (URISyntaxException | MalformedURLException e) {
|
||||
// ignore this event
|
||||
|
@ -210,11 +213,15 @@ public class FbScraper {
|
|||
protected void redirectUrl (String url) {
|
||||
FbRedirectionResolver resolver = new FbRedirectionResolver(this, url);
|
||||
|
||||
Log.d("scraperLog", "redirectUrl: "+url);
|
||||
|
||||
resolver.execute();
|
||||
}
|
||||
protected void redirectionResultCallback(String url) {
|
||||
this.input_url = url;
|
||||
|
||||
Log.d("scraperLog", "redirectUrlCb: "+url);
|
||||
|
||||
// now try again with expanded url
|
||||
this.run();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue