Austin Huang
5 years ago
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
31 changed files with 593 additions and 101 deletions
-
4app/build.gradle
-
5app/src/main/java/awais/instagrabber/InstaApp.java
-
163app/src/main/java/awais/instagrabber/MainHelper.java
-
3app/src/main/java/awais/instagrabber/activities/CommentsViewer.java
-
28app/src/main/java/awais/instagrabber/activities/Main.java
-
29app/src/main/java/awais/instagrabber/activities/PostViewer.java
-
19app/src/main/java/awais/instagrabber/activities/ProfileViewer.java
-
30app/src/main/java/awais/instagrabber/adapters/FeedAdapter.java
-
5app/src/main/java/awais/instagrabber/adapters/SuggestionsAdapter.java
-
3app/src/main/java/awais/instagrabber/adapters/viewholder/FeedItemViewHolder.java
-
5app/src/main/java/awais/instagrabber/asyncs/FeedFetcher.java
-
79app/src/main/java/awais/instagrabber/asyncs/LocationFetcher.java
-
4app/src/main/java/awais/instagrabber/asyncs/PostFetcher.java
-
10app/src/main/java/awais/instagrabber/asyncs/PostsFetcher.java
-
9app/src/main/java/awais/instagrabber/asyncs/StoryStatusFetcher.java
-
16app/src/main/java/awais/instagrabber/asyncs/SuggestionsFetcher.java
-
12app/src/main/java/awais/instagrabber/customviews/helpers/VideoAwareRecyclerScroller.java
-
7app/src/main/java/awais/instagrabber/dialogs/QuickAccessDialog.java
-
10app/src/main/java/awais/instagrabber/models/FeedModel.java
-
44app/src/main/java/awais/instagrabber/models/LocationModel.java
-
8app/src/main/java/awais/instagrabber/models/ViewerPostModel.java
-
1app/src/main/java/awais/instagrabber/models/enums/SuggestionType.java
-
2app/src/main/java/awais/instagrabber/utils/Constants.java
-
68app/src/main/java/awais/instagrabber/utils/DataBox.java
-
3app/src/main/java/awais/instagrabber/utils/ExportImportUtils.java
-
2app/src/main/java/awais/instagrabber/utils/FlavorTown.java
-
1app/src/main/java/awaisomereport/LogCollector.java
-
BINapp/src/main/res/drawable/ic_location.png
-
120app/src/main/res/layout/activity_main.xml
-
2app/src/main/res/values/strings.xml
-
2fastlane/metadata/android/changelogs/35.txt
@ -0,0 +1,79 @@ |
|||
package awais.instagrabber.asyncs; |
|||
|
|||
import android.os.AsyncTask; |
|||
import android.util.Log; |
|||
|
|||
import androidx.annotation.Nullable; |
|||
|
|||
import org.json.JSONArray; |
|||
import org.json.JSONObject; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.net.HttpURLConnection; |
|||
import java.net.URL; |
|||
|
|||
import awais.instagrabber.BuildConfig; |
|||
import awais.instagrabber.interfaces.FetchListener; |
|||
import awais.instagrabber.models.LocationModel; |
|||
import awais.instagrabber.utils.Constants; |
|||
import awais.instagrabber.utils.Utils; |
|||
import awaisomereport.LogCollector; |
|||
|
|||
import static awais.instagrabber.utils.Utils.logCollector; |
|||
|
|||
public final class LocationFetcher extends AsyncTask<Void, Void, LocationModel> { |
|||
private final FetchListener<LocationModel> fetchListener; |
|||
private final String idSlug; |
|||
|
|||
public LocationFetcher(String idSlug, FetchListener<LocationModel> fetchListener) { |
|||
Log.d("austin_debug", idSlug); |
|||
// idSlug = id + "/" + slug |
|||
this.idSlug = idSlug; |
|||
this.fetchListener = fetchListener; |
|||
} |
|||
|
|||
@Nullable |
|||
@Override |
|||
protected LocationModel doInBackground(final Void... voids) { |
|||
LocationModel result = null; |
|||
|
|||
try { |
|||
final HttpURLConnection conn = (HttpURLConnection) new URL("https://www.instagram.com/explore/locations/" + idSlug + "/?__a=1").openConnection(); |
|||
conn.setUseCaches(true); |
|||
conn.connect(); |
|||
|
|||
if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) { |
|||
final JSONObject user = new JSONObject(Utils.readFromConnection(conn)).getJSONObject("graphql").getJSONObject(Constants.EXTRAS_LOCATION); |
|||
|
|||
final JSONObject timelineMedia = user.getJSONObject("edge_location_to_media"); |
|||
if (timelineMedia.has("edges")) { |
|||
final JSONArray edges = timelineMedia.getJSONArray("edges"); |
|||
} |
|||
|
|||
result = new LocationModel( |
|||
user.getString(Constants.EXTRAS_ID) + "/" + user.getString("slug"), |
|||
user.getString("name"), |
|||
user.getString("blurb"), |
|||
user.getString("website"), |
|||
user.getString("profile_pic_url"), |
|||
timelineMedia.getLong("count"), |
|||
BigDecimal.valueOf(user.optDouble("lat", 0d)).toString(), |
|||
BigDecimal.valueOf(user.optDouble("lng", 0d)).toString() |
|||
); |
|||
} |
|||
|
|||
conn.disconnect(); |
|||
} catch (final Exception e) { |
|||
if (logCollector != null) |
|||
logCollector.appendException(e, LogCollector.LogFile.ASYNC_LOCATION_FETCHER, "doInBackground"); |
|||
if (BuildConfig.DEBUG) Log.e("AWAISKING_APP", "", e); |
|||
} |
|||
|
|||
return result; |
|||
} |
|||
|
|||
@Override |
|||
protected void onPostExecute(final LocationModel result) { |
|||
if (fetchListener != null) fetchListener.onResult(result); |
|||
} |
|||
} |
@ -0,0 +1,44 @@ |
|||
package awais.instagrabber.models; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
public final class LocationModel implements Serializable { |
|||
private final long postCount; |
|||
private final String id, name, bio, url, sdProfilePic, lat, lng; |
|||
|
|||
public LocationModel(final String id, final String name, final String bio, final String url, |
|||
final String sdProfilePic, final long postCount, final String lat, final String lng) { |
|||
this.id = id; // <- id + "/" + slug |
|||
this.name = name; |
|||
this.bio = bio; |
|||
this.url = url; |
|||
this.sdProfilePic = sdProfilePic; |
|||
this.postCount = postCount; |
|||
this.lat = lat; |
|||
this.lng = lng; |
|||
} |
|||
|
|||
public String getId() { |
|||
return id; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
public String getBio() { |
|||
return bio; |
|||
} |
|||
|
|||
public String getUrl() { |
|||
return url; |
|||
} |
|||
|
|||
public String getGeo() { return "geo:"+lat+","+lng+"?z=17&q="+lat+","+lng+"("+name+")"; } |
|||
|
|||
public String getSdProfilePic() { |
|||
return sdProfilePic; |
|||
} |
|||
|
|||
public long getPostCount() { return postCount; } |
|||
} |
After Width: 132 | Height: 132 | Size: 8.0 KiB |
@ -1,7 +1,7 @@ |
|||
* You can now write comments, and reply/like/delete comments through the menu (by clicking the comment) |
|||
* Liked comments are shown with a pink background |
|||
* You can now share posts in the post viewer |
|||
* You can now see the geotag name of a post |
|||
* Geotag viewing/searching support |
|||
* Search field is now empty if you're viewing your own profile while logged in |
|||
* Post like counts are now displayed (The button texts are slightly reduced to accomodate @world_record_egg) (logged in only) |
|||
* Mute buttons are changed to display the current status (i.e. muted icon when muted, sound icon when not muted) |
Write
Preview
Loading…
Cancel
Save
Reference in new issue