Skip to content
This repository has been archived by the owner on Dec 2, 2023. It is now read-only.

Commit

Permalink
Added new feature
Browse files Browse the repository at this point in the history
Added the ability to set a custom image path of the widget (can be an URL or a path to the image on your computer).
  • Loading branch information
Serena1432 committed Nov 1, 2022
1 parent e9309af commit 39bd5a7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,12 @@ void GetInformation()
html.LoadHtml(s);
if (!String.IsNullOrEmpty(cookie))
{
var avatar = html.DocumentNode.SelectSingleNode("//div[contains(@class, 'acw')]").SelectSingleNode("//img[contains(@alt, 'profile picture')]").Attributes["src"].Value.Replace("&", "&");
pictureBox1.Load(avatar);
if (String.IsNullOrEmpty(Config.Read("CustomImagePath", "Config")))
{
var avatar = html.DocumentNode.SelectSingleNode("//div[contains(@class, 'acw')]").SelectSingleNode("//img[contains(@alt, 'profile picture')]").Attributes["src"].Value.Replace("&", "&");
pictureBox1.Load(avatar);
}
else pictureBox1.Load(Config.Read("CustomImagePath", "Config"));
var name = html.DocumentNode.SelectSingleNode("//span/div/span/strong").InnerText;
if (name.Contains("(")) name = name.Substring(0, name.IndexOf('(') - 1);
if (name.IndexOf('(') - 1 > 0) label1.Text = name.Substring(0, name.IndexOf('(') - 1);
Expand Down Expand Up @@ -162,8 +166,12 @@ void GetInformation()
}
else
{
var avatar = html.DocumentNode.SelectSingleNode("//img[contains(@alt, 'profile')]").Attributes["src"].Value.Replace("&", "&");
pictureBox1.Load(avatar);
if (String.IsNullOrEmpty(Config.Read("CustomImagePath", "Config")))
{
var avatar = html.DocumentNode.SelectSingleNode("//img[contains(@alt, 'profile')]").Attributes["src"].Value.Replace("&", "&");
pictureBox1.Load(avatar);
}
else pictureBox1.Load(Config.Read("CustomImagePath", "Config"));
var name = html.DocumentNode.SelectSingleNode("//div[@id='cover-name-root']").InnerText;
label1.Text = name;
label2.Text = "Active status unavailable";
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ AdditionalStyle=
| `AdditionalStyle` | `string` | The additional style of the texts. Supported additional styles are `Bold` or `Italic`. |
| `CustomName` | `string` | The custom name to be displayed instead of the actual Facebook name. |
| `CustomClickLink` | `string` | The custom link to be opened when clicking the widget, with `$id` as the user's Facebook ID. |
| `CustomImagePath` | `string` | The custom image path of the widget (can be *an URL* or *a path to the image on your computer*). |

If you don't want to configure this application yourself, there are some presets on the `Presets` folder of the pre-built application. Just copy one of them to the executable folder, rename it to `Config.ini` and edit the ID and cookie of that file.

Expand Down

0 comments on commit 39bd5a7

Please sign in to comment.