Compare commits
5 Commits
3-update-c
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 08f5c0a879 | |||
| 32dfc287d9 | |||
| 7cd6306914 | |||
| 8cd882cb22 | |||
| 3789ef20c7 |
@ -17,7 +17,7 @@ namespace AutoLikerCefSharpWpf
|
||||
var settings = new CefSettings()
|
||||
{
|
||||
//By default CefSharp will use an in-memory cache, you need to specify a Cache Folder to persist data
|
||||
CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache")
|
||||
CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "AutoLiker2\\Cache")
|
||||
};
|
||||
|
||||
//Example of setting a command line argument
|
||||
|
||||
@ -55,8 +55,10 @@ alObject.prototype.instagramStartClickProcess = function(retry=0) {
|
||||
let most_recent = jQuery('h2').eq(1);
|
||||
let jump_to_section = null;
|
||||
if (most_recent.length > 0) {
|
||||
thisObj.log(' - Using "Most Recent" list');
|
||||
jump_to_section = most_recent;
|
||||
} else if (most_recent.length == 0 && top_posts.length > 0) {
|
||||
thisObj.log(' - Using "Top Posts" list');
|
||||
jump_to_section = top_posts;
|
||||
}
|
||||
|
||||
@ -74,38 +76,49 @@ alObject.prototype.instagramStartClickProcess = function(retry=0) {
|
||||
}
|
||||
|
||||
} else {
|
||||
let mr_div = jump_to_section.next();
|
||||
thisObj.log('Scroll to list ..');
|
||||
jQuery('html, body').animate({ scrollTop: mr_div.offset().top }, 500);
|
||||
let parentX = mr_div.offset().left;
|
||||
let parentY = mr_div.offset().top;
|
||||
thisObj._scrollOffset = mr_div.offset();
|
||||
console.log('parentX: ' + parentX + ' ; parentY: ' + parentY);
|
||||
thisObj.runDelay(2000, () => {
|
||||
let child01 = mr_div.children('div').eq(0);
|
||||
let postLinks = child01.find('a');
|
||||
postLinks.each( function(i) {
|
||||
thisObj._postItems.push(jQuery(this).attr('href'));
|
||||
let divJumpTo = jump_to_section.parent(); // get parent <div> of <h2> element
|
||||
if (divJumpTo.siblings().length < 1) {
|
||||
divJumpTo = jump_to_section.parent().parent();
|
||||
}
|
||||
if (divJumpTo.siblings().length < 1) {
|
||||
thisObj.log('ERROR: couldn\'t find list of posts!');
|
||||
thisObj.runDelay(1000, () => {
|
||||
thisObj.restartProcess();
|
||||
});
|
||||
console.log('items:');
|
||||
console.log(thisObj._postItems);
|
||||
thisObj.log('Found posts: ' + thisObj._postItems.length);
|
||||
// get first post
|
||||
let element01 = jQuery('a[href="' + thisObj._postItems[0] + '"]');
|
||||
console.log(element01);
|
||||
let element02 = element01.find('img').eq(0);
|
||||
console.log(element02);
|
||||
console.log(element02.attr('src'));
|
||||
if (element02) {
|
||||
console.log('imgX: ' + element02.offset().left + ' ; imgY: ' + element02.offset().top);
|
||||
//let clickX = parseInt(parentX - element02.offset().left) + 1;
|
||||
let clickX = parseInt(element02.offset().left) + 30;
|
||||
let clickY = parseInt(parentY - element02.offset().top) + 60;
|
||||
console.log('clickX: ' + clickX + ' ; clickY: ' + clickY);
|
||||
thisObj.log('Will like this many posts: ' + thisObj._maxLikes);
|
||||
thisObj.instagramClickPost(element02, clickX, clickY);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
divJumpTo = divJumpTo.next(); // go to the next sibling (posts <div>)
|
||||
thisObj.log('Scroll to list ..');
|
||||
jQuery('html, body').animate({ scrollTop: divJumpTo.offset().top }, 500);
|
||||
let parentX = divJumpTo.offset().left;
|
||||
let parentY = divJumpTo.offset().top;
|
||||
thisObj._scrollOffset = divJumpTo.offset();
|
||||
console.log('parentX: ' + parentX + ' ; parentY: ' + parentY);
|
||||
thisObj.runDelay(2000, () => {
|
||||
let child01 = divJumpTo.children('div').eq(0);
|
||||
let postLinks = child01.find('a');
|
||||
postLinks.each(function (i) {
|
||||
thisObj._postItems.push(jQuery(this).attr('href'));
|
||||
});
|
||||
console.log('items:');
|
||||
console.log(thisObj._postItems);
|
||||
thisObj.log('Found posts: ' + thisObj._postItems.length);
|
||||
// get first post
|
||||
let element01 = jQuery('a[href="' + thisObj._postItems[0] + '"]');
|
||||
console.log(element01);
|
||||
let element02 = element01.find('img').eq(0);
|
||||
console.log(element02);
|
||||
console.log(element02.attr('src'));
|
||||
if (element02) {
|
||||
console.log('imgX: ' + element02.offset().left + ' ; imgY: ' + element02.offset().top);
|
||||
//let clickX = parseInt(parentX - element02.offset().left) + 1;
|
||||
let clickX = parseInt(element02.offset().left) + 30;
|
||||
let clickY = parseInt(parentY - element02.offset().top) + 60;
|
||||
console.log('clickX: ' + clickX + ' ; clickY: ' + clickY);
|
||||
thisObj.log('Will like this many posts: ' + thisObj._maxLikes);
|
||||
thisObj.instagramClickPost(element02, clickX, clickY);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\CefSharp.Common.120.2.70\build\CefSharp.Common.props" Condition="Exists('..\packages\CefSharp.Common.120.2.70\build\CefSharp.Common.props')" />
|
||||
<Import Project="..\packages\cef.redist.x86.120.2.7\build\cef.redist.x86.props" Condition="Exists('..\packages\cef.redist.x86.120.2.7\build\cef.redist.x86.props')" />
|
||||
<Import Project="..\packages\cef.redist.x64.120.2.7\build\cef.redist.x64.props" Condition="Exists('..\packages\cef.redist.x64.120.2.7\build\cef.redist.x64.props')" />
|
||||
<Import Project="..\packages\CefSharp.Common.126.2.70\build\CefSharp.Common.props" Condition="Exists('..\packages\CefSharp.Common.126.2.70\build\CefSharp.Common.props')" />
|
||||
<Import Project="..\packages\chromiumembeddedframework.runtime.win-x86.126.2.7\build\chromiumembeddedframework.runtime.win-x86.props" Condition="Exists('..\packages\chromiumembeddedframework.runtime.win-x86.126.2.7\build\chromiumembeddedframework.runtime.win-x86.props')" />
|
||||
<Import Project="..\packages\chromiumembeddedframework.runtime.win-x64.126.2.7\build\chromiumembeddedframework.runtime.win-x64.props" Condition="Exists('..\packages\chromiumembeddedframework.runtime.win-x64.126.2.7\build\chromiumembeddedframework.runtime.win-x64.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@ -83,14 +83,14 @@
|
||||
<ApplicationIcon>Resources\autoliker-512.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CefSharp, Version=120.2.70.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\CefSharp.Common.120.2.70\lib\net462\CefSharp.dll</HintPath>
|
||||
<Reference Include="CefSharp, Version=126.2.70.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\CefSharp.Common.126.2.70\lib\net462\CefSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CefSharp.Core, Version=120.2.70.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\CefSharp.Common.120.2.70\lib\net462\CefSharp.Core.dll</HintPath>
|
||||
<Reference Include="CefSharp.Core, Version=126.2.70.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\CefSharp.Common.126.2.70\lib\net462\CefSharp.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CefSharp.Wpf, Version=120.2.70.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\CefSharp.Wpf.120.2.70\lib\net462\CefSharp.Wpf.dll</HintPath>
|
||||
<Reference Include="CefSharp.Wpf, Version=126.2.70.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\CefSharp.Wpf.126.2.70\lib\net462\CefSharp.Wpf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MaterialDesignColors, Version=2.1.4.0, Culture=neutral, PublicKeyToken=df2a72020bd7962a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MaterialDesignColors.2.1.4\lib\net462\MaterialDesignColors.dll</HintPath>
|
||||
@ -99,7 +99,7 @@
|
||||
<HintPath>..\packages\MaterialDesignThemes.4.9.0\lib\net462\MaterialDesignThemes.Wpf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xaml.Behaviors, Version=1.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.77\lib\net462\Microsoft.Xaml.Behaviors.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.122\lib\net462\Microsoft.Xaml.Behaviors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
@ -161,6 +161,7 @@
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="app.manifest" />
|
||||
<None Include="README.md" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
@ -197,11 +198,11 @@
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\MaterialDesignThemes.4.9.0\build\MaterialDesignThemes.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MaterialDesignThemes.4.9.0\build\MaterialDesignThemes.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\cef.redist.x64.120.2.7\build\cef.redist.x64.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x64.120.2.7\build\cef.redist.x64.props'))" />
|
||||
<Error Condition="!Exists('..\packages\cef.redist.x86.120.2.7\build\cef.redist.x86.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x86.120.2.7\build\cef.redist.x86.props'))" />
|
||||
<Error Condition="!Exists('..\packages\CefSharp.Common.120.2.70\build\CefSharp.Common.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Common.120.2.70\build\CefSharp.Common.props'))" />
|
||||
<Error Condition="!Exists('..\packages\CefSharp.Common.120.2.70\build\CefSharp.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Common.120.2.70\build\CefSharp.Common.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\chromiumembeddedframework.runtime.win-x64.126.2.7\build\chromiumembeddedframework.runtime.win-x64.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\chromiumembeddedframework.runtime.win-x64.126.2.7\build\chromiumembeddedframework.runtime.win-x64.props'))" />
|
||||
<Error Condition="!Exists('..\packages\chromiumembeddedframework.runtime.win-x86.126.2.7\build\chromiumembeddedframework.runtime.win-x86.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\chromiumembeddedframework.runtime.win-x86.126.2.7\build\chromiumembeddedframework.runtime.win-x86.props'))" />
|
||||
<Error Condition="!Exists('..\packages\CefSharp.Common.126.2.70\build\CefSharp.Common.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Common.126.2.70\build\CefSharp.Common.props'))" />
|
||||
<Error Condition="!Exists('..\packages\CefSharp.Common.126.2.70\build\CefSharp.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Common.126.2.70\build\CefSharp.Common.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\MaterialDesignThemes.4.9.0\build\MaterialDesignThemes.targets" Condition="Exists('..\packages\MaterialDesignThemes.4.9.0\build\MaterialDesignThemes.targets')" />
|
||||
<Import Project="..\packages\CefSharp.Common.120.2.70\build\CefSharp.Common.targets" Condition="Exists('..\packages\CefSharp.Common.120.2.70\build\CefSharp.Common.targets')" />
|
||||
<Import Project="..\packages\CefSharp.Common.126.2.70\build\CefSharp.Common.targets" Condition="Exists('..\packages\CefSharp.Common.126.2.70\build\CefSharp.Common.targets')" />
|
||||
</Project>
|
||||
@ -2,7 +2,6 @@
|
||||
using CefSharp;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
|
||||
@ -21,7 +20,7 @@ namespace AutoLikerCefSharpWpf
|
||||
InitializeComponent();
|
||||
|
||||
// version
|
||||
this.AutoLikerVersion = "v2.0.6-20240205";
|
||||
this.AutoLikerVersion = "v2.1.3-20240707";
|
||||
this.DataContext = this;
|
||||
// manage settings in UI
|
||||
this._alsm = new AutoLikerSettingsManager(this);
|
||||
@ -84,7 +83,11 @@ namespace AutoLikerCefSharpWpf
|
||||
args.Frame.ExecuteJavaScriptAsync(jq);
|
||||
|
||||
// Inject AutoLiker class
|
||||
#if DEBUG
|
||||
string aljs = JavaScriptProcessor.ReturnJavaScriptFromFile("autotag_injection.js");
|
||||
#else
|
||||
string aljs = JavaScriptProcessor.ReturnJavaScriptFromFile("autotag_injection_min.js");
|
||||
#endif
|
||||
args.Frame.ExecuteJavaScriptAsync(aljs);
|
||||
|
||||
this.Dispatcher.Invoke(() =>
|
||||
|
||||
15
AutoLikerCefSharpWpf/README.md
Normal file
15
AutoLikerCefSharpWpf/README.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Auto Liker CefSharp WPF
|
||||
Automate liking of Instagram posts.
|
||||
|
||||
## Release Notes
|
||||
* v2.1.3-20240707
|
||||
* Update to CefSharp 126.2.70
|
||||
* Update Microsoft.Xaml.Behaviors.Wpf to 1.1.122
|
||||
* v2.1.2-20240615
|
||||
* Update to CefSharp 125.0.210 #10
|
||||
* v2.1.1-20240523
|
||||
* Update to CefSharp 124.3.80 #8
|
||||
* v2.1.0-20240330
|
||||
* Update to CefSharp 123 #5
|
||||
* v2.0.7-20240330
|
||||
* Fix scrolling to h2 #3
|
||||
@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="cef.redist.x64" version="120.2.7" targetFramework="net472" />
|
||||
<package id="cef.redist.x86" version="120.2.7" targetFramework="net472" />
|
||||
<package id="CefSharp.Common" version="120.2.70" targetFramework="net472" />
|
||||
<package id="CefSharp.Wpf" version="120.2.70" targetFramework="net472" />
|
||||
<package id="CefSharp.Common" version="126.2.70" targetFramework="net472" />
|
||||
<package id="CefSharp.Wpf" version="126.2.70" targetFramework="net472" />
|
||||
<package id="chromiumembeddedframework.runtime.win-x64" version="126.2.7" targetFramework="net472" />
|
||||
<package id="chromiumembeddedframework.runtime.win-x86" version="126.2.7" targetFramework="net472" />
|
||||
<package id="MaterialDesignColors" version="2.1.4" targetFramework="net472" />
|
||||
<package id="MaterialDesignThemes" version="4.9.0" targetFramework="net472" />
|
||||
<package id="Microsoft.Xaml.Behaviors.Wpf" version="1.1.77" targetFramework="net472" />
|
||||
<package id="Microsoft.Xaml.Behaviors.Wpf" version="1.1.122" targetFramework="net472" />
|
||||
</packages>
|
||||
Loading…
x
Reference in New Issue
Block a user