Skip to content

Commit

Permalink
fix(Instagram): profile element changed (PreMiD#6749)
Browse files Browse the repository at this point in the history
* fix(Instagram): profile element changed

* style(Instagram): style

Co-Authored-By: Bas950 <bas.van.zanten007@gmail.com>

Co-authored-by: Bas950 <bas.van.zanten007@gmail.com>
  • Loading branch information
Dark_Ville and Bas950 authored Sep 4, 2022
1 parent 89bcdef commit e37477b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion websites/I/Instagram/dist/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"vi_VN": "Một cách đơn giản, vui và sáng tạo để chụp, chỉnh sửa và chia sẻ các bức ảnh, video và tin nhắn với gia đình và bạn bè."
},
"url": "www.instagram.com",
"version": "2.2.3",
"version": "2.2.4",
"logo": "https://i.imgur.com/UFQy3sk.png",
"thumbnail": "https://i.imgur.com/gcBDsYj.png",
"color": "#E1306C",
Expand Down
6 changes: 3 additions & 3 deletions websites/I/Instagram/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ presence.on("UpdateData", async () => {
]),
{ pathname } = window.location,
path = pathname.split("/"),
profileName = document.querySelector("div.XBGH5 h2");
[, profileName] = document.title.split("(");

if (elapsedTimeSetting) presenceData.startTimestamp = timestamp;

Expand Down Expand Up @@ -87,7 +87,7 @@ presence.on("UpdateData", async () => {
pathname.startsWith("/direct/t")
)
presenceData.details = "Direct Messages";
else if (profileName?.textContent === path[1]) {
else if (profileName.split(")")[0].replace("@", "") === path[1]) {
const profilePicture =
document.querySelector<HTMLImageElement>("img._6q-tv");

Expand All @@ -97,7 +97,7 @@ presence.on("UpdateData", async () => {
.querySelector("head > title")
?.textContent.split("(")[0]
.trim() ?? "Unknown"
} (@${profileName.textContent})`;
} (${profileName.split(")")[0]})`;

if (profilePicture)
presenceData.smallImageKey = await getShortURL(profilePicture.src);
Expand Down

0 comments on commit e37477b

Please sign in to comment.