mirror of
https://github.com/jesperh1/view-youtube-dislike.git
synced 2025-06-07 11:58:54 +01:00
Small changes
This commit is contained in:
parent
60912aea3f
commit
838d13f453
@ -9,8 +9,8 @@ android {
|
|||||||
applicationId "com.jesperh.showyoutubedislikes"
|
applicationId "com.jesperh.showyoutubedislikes"
|
||||||
minSdk 21
|
minSdk 21
|
||||||
targetSdk 32
|
targetSdk 32
|
||||||
versionCode 1
|
versionCode 3
|
||||||
versionName "1.0"
|
versionName "0.2"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
@ -33,7 +33,6 @@ dependencies {
|
|||||||
implementation 'com.google.android.material:material:1.4.0'
|
implementation 'com.google.android.material:material:1.4.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
|
||||||
implementation 'com.android.volley:volley:1.2.0'
|
implementation 'com.android.volley:volley:1.2.0'
|
||||||
implementation files('/home/jesper/AndroidStudioProjects/ShowYoutubeDislikes/app/libs/json-simple-1.1.1.jar')
|
|
||||||
testImplementation 'junit:junit:4.+'
|
testImplementation 'junit:junit:4.+'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||||
|
20
app/release/output-metadata.json
Normal file
20
app/release/output-metadata.json
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"artifactType": {
|
||||||
|
"type": "APK",
|
||||||
|
"kind": "Directory"
|
||||||
|
},
|
||||||
|
"applicationId": "com.jesperh.showyoutubedislikes",
|
||||||
|
"variantName": "release",
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"type": "SINGLE",
|
||||||
|
"filters": [],
|
||||||
|
"attributes": [],
|
||||||
|
"versionCode": 1,
|
||||||
|
"versionName": "1.0",
|
||||||
|
"outputFile": "app-release.apk"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"elementType": "File"
|
||||||
|
}
|
@ -13,26 +13,15 @@ import android.widget.Toast;
|
|||||||
|
|
||||||
import com.android.volley.Request;
|
import com.android.volley.Request;
|
||||||
import com.android.volley.RequestQueue;
|
import com.android.volley.RequestQueue;
|
||||||
import com.android.volley.Response;
|
|
||||||
import com.android.volley.VolleyError;
|
|
||||||
import com.android.volley.toolbox.StringRequest;
|
import com.android.volley.toolbox.StringRequest;
|
||||||
import com.android.volley.toolbox.Volley;
|
import com.android.volley.toolbox.Volley;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import java.net.ProtocolException;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Scanner;
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class DisplayMessageActivity extends AppCompatActivity {
|
public class DisplayMessageActivity extends AppCompatActivity {
|
||||||
|
|
||||||
// Simpler Regex: ^(https?\:\/\/)?((www\.)?youtube\.com|youtu\.be)\/.+$
|
|
||||||
// ^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu.be))(\/(?:[\w\-]+\?v=|embed\/|v\/)?)([\w\-]+)(\S+)?$
|
|
||||||
Pattern YoutubeRegex = Pattern.compile("^(https?\\:\\/\\/)?((www\\.)?youtube\\.com|youtu\\.be)\\/.+$", Pattern.CASE_INSENSITIVE);
|
Pattern YoutubeRegex = Pattern.compile("^(https?\\:\\/\\/)?((www\\.)?youtube\\.com|youtu\\.be)\\/.+$", Pattern.CASE_INSENSITIVE);
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@ -111,19 +100,10 @@ public class DisplayMessageActivity extends AppCompatActivity {
|
|||||||
alertDialog.show();
|
alertDialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Capture the layout's TextView and set the string as its text
|
|
||||||
|
|
||||||
public static String API_BASE_URL = "https://returnyoutubedislikeapi.com/";
|
public static String API_BASE_URL = "https://returnyoutubedislikeapi.com/";
|
||||||
public static String API_QUERY_URL = "votes?videoId=";
|
public static String API_QUERY_URL = "votes?videoId=";
|
||||||
|
|
||||||
//kxOuG8jMIgI
|
|
||||||
// Youtube Example:
|
|
||||||
// https://www.youtube.com/watch?v=Nz9b0oJw69I
|
|
||||||
//youtu.be Example:
|
|
||||||
// https://youtu.be/Nz9b0oJw69I
|
|
||||||
// API: Example
|
|
||||||
// https://returnyoutubedislikeapi.com/votes?videoId=kxOuG8jMIgI
|
|
||||||
|
|
||||||
|
|
||||||
public String GetDataAPI(String YouTubeLink)
|
public String GetDataAPI(String YouTubeLink)
|
||||||
{
|
{
|
||||||
@ -144,7 +124,7 @@ public class DisplayMessageActivity extends AppCompatActivity {
|
|||||||
String Dislike_Count = "";
|
String Dislike_Count = "";
|
||||||
String view_count = "";
|
String view_count = "";
|
||||||
String like_count = "";
|
String like_count = "";
|
||||||
//TextView textView = findViewById(R.id.YTDislikes);
|
|
||||||
String FINAL_URL = API_BASE_URL + API_QUERY_URL + result;
|
String FINAL_URL = API_BASE_URL + API_QUERY_URL + result;
|
||||||
final TextView textViewDislikes = (TextView) findViewById(R.id.YTDislikes);
|
final TextView textViewDislikes = (TextView) findViewById(R.id.YTDislikes);
|
||||||
final TextView textViewLikes = (TextView) findViewById(R.id.YTLikes);
|
final TextView textViewLikes = (TextView) findViewById(R.id.YTLikes);
|
||||||
@ -169,10 +149,6 @@ public class DisplayMessageActivity extends AppCompatActivity {
|
|||||||
);
|
);
|
||||||
RequestQueue requestQueue = Volley.newRequestQueue(this);
|
RequestQueue requestQueue = Volley.newRequestQueue(this);
|
||||||
requestQueue.add(myRequest);
|
requestQueue.add(myRequest);
|
||||||
//textView.setText("f");
|
|
||||||
|
|
||||||
//TextView textView = findViewById(R.id.YTViews);
|
|
||||||
//textView.setText(FINAL_URL);
|
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user