Skip to content

Commit

Permalink
v3.0.0.47 - Fix for twitter API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
e621-ReBot committed Jan 10, 2025
1 parent e668fb2 commit 30cb331
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 22 deletions.
16 changes: 8 additions & 8 deletions e621 ReBot v3/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,21 @@ protected override void OnExit(ExitEventArgs e)

// - - - - - - - - - - - - - - - -

[LibraryImport("User32.dll", EntryPoint = "SetForegroundWindow")]
[DllImport("User32.dll", EntryPoint = "SetForegroundWindow")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool SetForegroundWindow(IntPtr hWnd);
private static extern bool SetForegroundWindow(IntPtr hWnd);

[LibraryImport("User32.dll", EntryPoint = "ShowWindow")]
[DllImport("User32.dll", EntryPoint = "ShowWindow")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool ShowWindow(IntPtr hWnd, int nCmdShow);
private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);

[LibraryImport("User32.dll", EntryPoint = "IsIconic")]
[DllImport("User32.dll", EntryPoint = "IsIconic")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool IsIconic(IntPtr hWnd);
private static extern bool IsIconic(IntPtr hWnd);

[LibraryImport("User32.dll", EntryPoint = "IsWindowVisible")]
[DllImport("User32.dll", EntryPoint = "IsWindowVisible")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool IsWindowVisible(IntPtr hWnd);
private static extern bool IsWindowVisible(IntPtr hWnd);

// shows the window of the single-instance that is already open
private static void ShowExistingWindow()
Expand Down
5 changes: 2 additions & 3 deletions e621 ReBot v3/Modules/CefSharp/CefBrowser_CefSharpStuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,8 @@ protected override void OnResourceLoadComplete(IWebBrowser chromiumWebBrowser, I
if (Twitter.StartsWith("https://x.com/i/api/graphql/")) //logged in
{
//[@something]makes it go two levels deep.
//data.user.result.timeline_v2.timeline.instructions[0].entries[0].content.itemContent.tweet_results.result.legacy.extended_entities
TweetsContainer = JObjectTemp.SelectTokens("$..data..instructions[?(@.type=='TimelineAddToModule')].moduleItems[*]..tweet_results.result.legacy").Where(token => token["extended_entities"] != null);
if (!TweetsContainer.Any()) TweetsContainer = JObjectTemp.SelectTokens("$..data..instructions[?(@.type=='TimelineAddEntries')].entries[*]..tweet_results.result.legacy").Where(token => token["extended_entities"] != null);
TweetsContainer = JObjectTemp.SelectTokens("$..data..instructions[?(@.type=='TimelineAddToModule')].moduleItems[*]..tweet_results.result..legacy").Where(token => token["extended_entities"] != null); //media page
if (!TweetsContainer.Any()) TweetsContainer = JObjectTemp.SelectTokens("$..data..instructions[?(@.type=='TimelineAddEntries')].entries[*]..tweet_results.result..legacy").Where(token => token["extended_entities"] != null); //status page
}
if (Twitter.StartsWith("https://api.x.com/graphql/")) //not logged in
{
Expand Down
2 changes: 1 addition & 1 deletion e621 ReBot v3/Modules/Grabber/Module_Grabber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static Module_Grabber()
new Regex(@"^\w+://inkbunny\.net/((s|gallery|scraps)/\w+|submissionsviewall.php)"),
new Regex(@"^\w+://www\.pixiv\.net/\w+/(artworks|users)/\d+"),
new Regex(@"^\w+://www\.hiccears\.com/((contents|file).+(/.+)?|p/.+/illustrations)"),
new Regex(@"^\w+://x\.com/.+/(media|status/\d+/?)"),
new Regex(@"^\w+://x\.com/.+/(media|status/\d+/?$)"),
new Regex(@"^\w+://\w+\.newgrounds\.com/(movies/?|portal/view/\d+|art/?(view/.+|\w+)?)"),
new Regex(@"^\w+://\w+\.sofurry\.com/(view/\d+|artwork|browse/\w+/art\?uid=\d+)"),
new Regex(@"^\w+://www\.weasyl\.com/((~.+/)?(submissions/\w+(/.+)?)|search.+find=submit)"),
Expand Down
8 changes: 4 additions & 4 deletions e621 ReBot v3/Modules/Module_VolumeControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ namespace e621_ReBot_v3
{
partial class Module_VolumeControl
{
[LibraryImport("winmm.dll")]
public static partial uint waveOutSetVolume(IntPtr hwo, uint dwVolume);
[DllImport("winmm.dll")]
public static extern uint waveOutSetVolume(IntPtr hwo, uint dwVolume);

[LibraryImport("winmm.dll")]
public static partial uint waveOutGetVolume(IntPtr hwo, ref uint pdwVolume);
[DllImport("winmm.dll")]
public static extern uint waveOutGetVolume(IntPtr hwo, ref uint pdwVolume);

public static int GetApplicationVolume()
{
Expand Down
8 changes: 4 additions & 4 deletions e621 ReBot v3/Windows/Window_Tagger.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,16 +275,16 @@ private void Tags_TextBox_PreviewKeyDown(object sender, KeyEventArgs e)
}
else
{
List<string> textBoxTags = Tags_TextBox.Text.Split(' ', StringSplitOptions.RemoveEmptyEntries).Distinct().ToList();
List<string> TextBoxTags = Tags_TextBox.Text.Split(' ', StringSplitOptions.RemoveEmptyEntries).Distinct().ToList();
for (int i = PasteTags.Count - 1; i >= 0; i--)
{
if (textBoxTags.Contains(PasteTags[i]))
if (TextBoxTags.Contains(PasteTags[i]))
{
PasteTags.RemoveAt(i);
}
}
textBoxTags.AddRange(PasteTags);
Tags_TextBox.Text = $"{string.Join(' ', textBoxTags)} ";
TextBoxTags.AddRange(PasteTags);
Tags_TextBox.Text = $"{string.Join(' ', TextBoxTags)} ";
}
Tags_TextBox.SelectionStart = Tags_TextBox.Text.Length;
CountTags();
Expand Down
4 changes: 2 additions & 2 deletions e621 ReBot v3/e621 ReBot v3.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<RootNamespace>e621_ReBot_v3</RootNamespace>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<PlatformTarget>x64</PlatformTarget>
<ApplicationIcon>Resources\ReBot_Icon.ico</ApplicationIcon>
<Platforms>x64</Platforms>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<FileVersion>3.0.0.46</FileVersion>
<FileVersion>3.0.0.47</FileVersion>
<StartupObject>e621_ReBot_v3.App</StartupObject>
<IsPublishable>False</IsPublishable>
<RepositoryUrl>https://github.com/e621-ReBot/e621-ReBot-v3</RepositoryUrl>
Expand Down

0 comments on commit 30cb331

Please sign in to comment.