diff --git a/Tweetodon/Account.pm b/RSSTootalizer/Account.pm similarity index 50% rename from Tweetodon/Account.pm rename to RSSTootalizer/Account.pm index 08c6385..83f0ccb 100644 --- a/Tweetodon/Account.pm +++ b/RSSTootalizer/Account.pm @@ -1,11 +1,11 @@ # vim: set foldmarker={,}: use strict; -use Tweetodon::Base; +use RSSTootalizer::Base; -package Tweetodon::Account; -@Tweetodon::Account::ISA = qw(Tweetodon::Base); +package RSSTootalizer::Account; +@RSSTootalizer::Account::ISA = qw(RSSTootalizer::Base); use JSON; -use Tweetodon::Application; +use RSSTootalizer::Application; use Data::Dumper; sub dbTable :lvalue { "accounts"; } @@ -15,7 +15,7 @@ sub orderBy :lvalue { "username ASC"; } # Object methods sub application { my $self = shift; - my $retVal = Tweetodon::Application->get_by("id", $self->{"data"}->{"application_id"}); + my $retVal = RSSTootalizer::Application->get_by("id", $self->{"data"}->{"application_id"}); return $retVal; } diff --git a/Tweetodon/App.pm b/RSSTootalizer/App.pm similarity index 53% rename from Tweetodon/App.pm rename to RSSTootalizer/App.pm index 4e67a1c..5a17216 100644 --- a/Tweetodon/App.pm +++ b/RSSTootalizer/App.pm @@ -1,9 +1,9 @@ # vim: set foldmarker={,}: use strict; -use Tweetodon::Base; +use RSSTootalizer::Base; -package Tweetodon::App; -@Tweetodon::App::ISA = qw(Tweetodon::Base); +package RSSTootalizer::App; +@RSSTootalizer::App::ISA = qw(RSSTootalizer::Base); use JSON; use Data::Dumper; @@ -15,7 +15,7 @@ sub get_or_create_by_instance { my $class = shift; my $instance = shift; - my $app = Tweetodon::DB->doSELECT("SELECT * FROM apps WHERE instance = ?", $instance); + my $app = RSSTootalizer::DB->doSELECT("SELECT * FROM apps WHERE instance = ?", $instance); $app = $$app[0]; unless (defined($app)){ open(DATA, "./register_app.bash '$main::config->{app}->{client_name}' '$main::config->{app}->{redirect_uris}' '$main::config->{app}->{website}' '$instance'|"); @@ -27,9 +27,9 @@ sub get_or_create_by_instance { close DATA; $reply = decode_json($reply); - Tweetodon::DB->doINSERT("INSERT INTO apps (instance, instance_id, instance_client_id, instance_client_secret) VALUES (?, ?, ?, ?)", $instance, $reply->{id}, $reply->{client_id}, $reply->{client_secret}); + RSSTootalizer::DB->doINSERT("INSERT INTO apps (instance, instance_id, instance_client_id, instance_client_secret) VALUES (?, ?, ?, ?)", $instance, $reply->{id}, $reply->{client_id}, $reply->{client_secret}); - $app = Tweetodon::DB->doSELECT("SELECT * FROM apps WHERE instance = ?", $instance); + $app = RSSTootalizer::DB->doSELECT("SELECT * FROM apps WHERE instance = ?", $instance); $app = $$app[0]; } $class->new($app) @@ -39,7 +39,7 @@ sub get_or_create_by_instance { sub app { my $self = shift; - my $retVal = Tweetodon::Application->get_by("id", $self->{"data"}->{"app_id"}); + my $retVal = RSSTootalizer::Application->get_by("id", $self->{"data"}->{"app_id"}); return $retVal; } diff --git a/Tweetodon/Base.pm b/RSSTootalizer/Base.pm similarity index 61% rename from Tweetodon/Base.pm rename to RSSTootalizer/Base.pm index 459fb92..01d7e7f 100644 --- a/Tweetodon/Base.pm +++ b/RSSTootalizer/Base.pm @@ -1,17 +1,17 @@ # vim: set foldmarker={,}: use strict; -package Tweetodon::Base; +package RSSTootalizer::Base; use JSON; use Data::Dumper; -use Tweetodon::DB; +use RSSTootalizer::DB; use Digest::MD5 qw(md5_hex); # Class functions sub all { my $class = shift; - my $all = Tweetodon::DB->doSELECT("SELECT * FROM ".$class->dbTable." ORDER BY ".$class->orderBy); + my $all = RSSTootalizer::DB->doSELECT("SELECT * FROM ".$class->dbTable." ORDER BY ".$class->orderBy); my @retVal; foreach my $object (@$all){ $object = $class->new($object); @@ -24,7 +24,7 @@ sub get_by { my $key = shift; my $value = shift; - my $retVal = Tweetodon::DB->doSELECT("SELECT * FROM ".$class->dbTable." WHERE ".$key." ".($value =~ /%/ ? "LIKE" : "=")." ?", $value); + my $retVal = RSSTootalizer::DB->doSELECT("SELECT * FROM ".$class->dbTable." WHERE ".$key." ".($value =~ /%/ ? "LIKE" : "=")." ?", $value); $retVal = $$retVal[0]; return 0 unless defined($retVal); @@ -34,8 +34,8 @@ sub create { my $class = shift; my %data = @_; - Tweetodon::DB->doINSERThash($class->dbTable, %data); - my $data = Tweetodon::DB->doSELECT("SELECT * FROM ".$class->dbTable." WHERE ID = LAST_INSERT_ID()"); + RSSTootalizer::DB->doINSERThash($class->dbTable, %data); + my $data = RSSTootalizer::DB->doSELECT("SELECT * FROM ".$class->dbTable." WHERE ID = LAST_INSERT_ID()"); $data = $$data[0]; return $class->get_by("ID", $$data{ID}); } @@ -59,11 +59,11 @@ sub save { } else { delete $self->{"data"}->{"password"}; } - return Tweetodon::DB->doUPDATEhash($self->dbTable, "ID = ".$self->{"data"}->{"ID"}, %{$self->{"data"}}); + return RSSTootalizer::DB->doUPDATEhash($self->dbTable, "ID = ".$self->{"data"}->{"ID"}, %{$self->{"data"}}); } sub delete { my $self = shift; - return Tweetodon::DB->doDELETE("DELETE FROM ".$self->dbTable." WHERE ID = ?", $self->{data}->{ID}); + return RSSTootalizer::DB->doDELETE("DELETE FROM ".$self->dbTable." WHERE ID = ?", $self->{data}->{ID}); } 1; diff --git a/Tweetodon/DB.pm b/RSSTootalizer/DB.pm similarity index 99% rename from Tweetodon/DB.pm rename to RSSTootalizer/DB.pm index 6b6d54f..9f7ed20 100644 --- a/Tweetodon/DB.pm +++ b/RSSTootalizer/DB.pm @@ -1,7 +1,7 @@ # vim: set foldmarker={,}: use strict; -package Tweetodon::DB; +package RSSTootalizer::DB; use DBI; use Data::Dumper; use JSON; diff --git a/Tweetodon/Entry.pm b/RSSTootalizer/Entry.pm similarity index 63% rename from Tweetodon/Entry.pm rename to RSSTootalizer/Entry.pm index ee0691b..edcd247 100644 --- a/Tweetodon/Entry.pm +++ b/RSSTootalizer/Entry.pm @@ -1,9 +1,9 @@ # vim: set foldmarker={,}: use strict; -use Tweetodon::Base; +use RSSTootalizer::Base; -package Tweetodon::Entry; -@Tweetodon::Entry::ISA = qw(Tweetodon::Base); +package RSSTootalizer::Entry; +@RSSTootalizer::Entry::ISA = qw(RSSTootalizer::Base); use JSON; use Data::Dumper; diff --git a/Tweetodon/Feed.pm b/RSSTootalizer/Feed.pm similarity index 54% rename from Tweetodon/Feed.pm rename to RSSTootalizer/Feed.pm index e84de85..4d7c18e 100644 --- a/Tweetodon/Feed.pm +++ b/RSSTootalizer/Feed.pm @@ -1,13 +1,13 @@ # vim: set foldmarker={,}: use strict; -use Tweetodon::Base; +use RSSTootalizer::Base; -package Tweetodon::Feed; -@Tweetodon::Feed::ISA = qw(Tweetodon::Base); +package RSSTootalizer::Feed; +@RSSTootalizer::Feed::ISA = qw(RSSTootalizer::Base); use JSON; use Data::Dumper; -use Tweetodon::Filter; -use Tweetodon::Entry; +use RSSTootalizer::Filter; +use RSSTootalizer::Entry; use XML::Feed; use URI; @@ -20,7 +20,7 @@ sub get_by_user_instance { my $user = shift; my $instance = shift; - my $retVal = Tweetodon::DB->doSELECT("SELECT * FROM ".$class->dbTable." WHERE username = ? AND instance = ? ORDER BY ".$class->orderBy, $user, $instance); + my $retVal = RSSTootalizer::DB->doSELECT("SELECT * FROM ".$class->dbTable." WHERE username = ? AND instance = ? ORDER BY ".$class->orderBy, $user, $instance); my @retVal; foreach my $r (@$retVal){ @@ -39,18 +39,18 @@ sub create_and_fetch { my %ne; $ne{feed_id} = $self->{data}->{ID}; $ne{entry_link} = $entry->link(); - Tweetodon::Entry->create(%ne); + RSSTootalizer::Entry->create(%ne); } } # Object methods sub filters { my $self = shift; - my $filters = Tweetodon::DB->doSELECT("SELECT * FROM filters WHERE feed_id = ? ORDER BY ID ASC", $self->{data}->{ID}); + my $filters = RSSTootalizer::DB->doSELECT("SELECT * FROM filters WHERE feed_id = ? ORDER BY ID ASC", $self->{data}->{ID}); my @retVal; foreach my $r (@$filters){ - push @retVal, Tweetodon::Filter->new($r); + push @retVal, RSSTootalizer::Filter->new($r); } return @retVal; } @@ -65,18 +65,18 @@ sub entry_by { my $key = shift; my $value = shift; - my $sth = Tweetodon::DB->doSELECT("SELECT * FROM entries WHERE feed_id = ? AND $key = ?", $self->{data}->{ID}, $value); + my $sth = RSSTootalizer::DB->doSELECT("SELECT * FROM entries WHERE feed_id = ? AND $key = ?", $self->{data}->{ID}, $value); my @retVal; foreach my $r (@$sth){ - push @retVal, Tweetodon::Entry->new($r); + push @retVal, RSSTootalizer::Entry->new($r); } return @retVal; } sub user { my $self = shift; - my $sth = Tweetodon::DB->doSELECT("SELECT * FROM users WHERE username = ? and instance = ?", $self->{data}->{username}, $self->{data}->{instance}); + my $sth = RSSTootalizer::DB->doSELECT("SELECT * FROM users WHERE username = ? and instance = ?", $self->{data}->{username}, $self->{data}->{instance}); $sth = $$sth[0]; - return Tweetodon::User->new($sth); + return RSSTootalizer::User->new($sth); } 1; diff --git a/Tweetodon/Filter.pm b/RSSTootalizer/Filter.pm similarity index 85% rename from Tweetodon/Filter.pm rename to RSSTootalizer/Filter.pm index a0d4c5b..0d3094c 100644 --- a/Tweetodon/Filter.pm +++ b/RSSTootalizer/Filter.pm @@ -1,9 +1,9 @@ # vim: set foldmarker={,}: use strict; -use Tweetodon::Base; +use RSSTootalizer::Base; -package Tweetodon::Filter; -@Tweetodon::Filter::ISA = qw(Tweetodon::Base); +package RSSTootalizer::Filter; +@RSSTootalizer::Filter::ISA = qw(RSSTootalizer::Base); use JSON; use Data::Dumper; use URI::Escape; diff --git a/Tweetodon/Migration.pm b/RSSTootalizer/Migration.pm similarity index 61% rename from Tweetodon/Migration.pm rename to RSSTootalizer/Migration.pm index a42de7e..09a4262 100644 --- a/Tweetodon/Migration.pm +++ b/RSSTootalizer/Migration.pm @@ -1,9 +1,9 @@ # vim: set foldmarker={,}: use strict; -use Tweetodon::Base; +use RSSTootalizer::Base; -package Tweetodon::Migration; -@Tweetodon::Migration::ISA = qw(Tweetodon::Base); +package RSSTootalizer::Migration; +@RSSTootalizer::Migration::ISA = qw(RSSTootalizer::Base); use JSON; use Data::Dumper; diff --git a/Tweetodon/Token.pm b/RSSTootalizer/Token.pm similarity index 62% rename from Tweetodon/Token.pm rename to RSSTootalizer/Token.pm index 8e841ab..faafcfc 100644 --- a/Tweetodon/Token.pm +++ b/RSSTootalizer/Token.pm @@ -1,9 +1,9 @@ # vim: set foldmarker={,}: use strict; -use Tweetodon::Base; +use RSSTootalizer::Base; -package Tweetodon::Token; -@Tweetodon::Token::ISA = qw(Tweetodon::Base); +package RSSTootalizer::Token; +@RSSTootalizer::Token::ISA = qw(RSSTootalizer::Base); use JSON; use Data::Dumper; diff --git a/Tweetodon/User.pm b/RSSTootalizer/User.pm similarity index 86% rename from Tweetodon/User.pm rename to RSSTootalizer/User.pm index d596810..47efc45 100644 --- a/Tweetodon/User.pm +++ b/RSSTootalizer/User.pm @@ -1,11 +1,11 @@ # vim: set foldmarker={,}: use strict; -use Tweetodon::Base; +use RSSTootalizer::Base; -package Tweetodon::User; -@Tweetodon::User::ISA = qw(Tweetodon::Base); +package RSSTootalizer::User; +@RSSTootalizer::User::ISA = qw(RSSTootalizer::Base); use JSON; -use Tweetodon::Token; +use RSSTootalizer::Token; use Data::Dumper; sub dbTable :lvalue { "users"; } diff --git a/Tweetodon/Website.pm b/RSSTootalizer/Website.pm similarity index 98% rename from Tweetodon/Website.pm rename to RSSTootalizer/Website.pm index e37a7da..4c3d527 100644 --- a/Tweetodon/Website.pm +++ b/RSSTootalizer/Website.pm @@ -4,7 +4,7 @@ use strict; use HTML::Template; -package Tweetodon::Website; +package RSSTootalizer::Website; use Data::Dumper; sub requires_authentication { diff --git a/Tweetodon/Website/Callback.pm b/RSSTootalizer/Website/Callback.pm similarity index 67% rename from Tweetodon/Website/Callback.pm rename to RSSTootalizer/Website/Callback.pm index 2ddb3e8..825813c 100644 --- a/Tweetodon/Website/Callback.pm +++ b/RSSTootalizer/Website/Callback.pm @@ -2,17 +2,17 @@ use strict; use HTML::Template; -use Tweetodon::Website; -use Tweetodon::App; -use Tweetodon::Token; +use RSSTootalizer::Website; +use RSSTootalizer::App; +use RSSTootalizer::Token; -package Tweetodon::Website::Callback; -@Tweetodon::Website::Callback::ISA = qw(Tweetodon::Website); +package RSSTootalizer::Website::Callback; +@RSSTootalizer::Website::Callback::ISA = qw(RSSTootalizer::Website); use Data::Dumper; use UUID::Tiny; use Digest::SHA qw(sha256_base64); use JSON; -use Tweetodon::DB; +use RSSTootalizer::DB; sub requires_authentication { return 0; @@ -29,7 +29,7 @@ sub prerender { $self->{"params"}->{"currentmode"} = "Callback"; my $instance = $main::FORM{instance}; - my $app = Tweetodon::App->get_or_create_by_instance($instance); + my $app = RSSTootalizer::App->get_or_create_by_instance($instance); open(DATA, "./process_code.bash '$app->{data}->{instance_client_id}' '$app->{data}->{instance_client_secret}' '$main::FORM{code}' '$main::config->{app}->{redirect_uris}' '$instance'|"); my $reply; @@ -59,7 +59,7 @@ sub prerender { my $session_id = UUID::Tiny::create_UUID_as_string(UUID_V5, time().$$reply{acct}); - Tweetodon::DB->doINSERT("INSERT INTO users (username, username_sha256, instance, instance_sha256, access_token, session_id) VALUES (?, ?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE access_token=?, session_id=?", $$reply{acct}, sha256_base64($$reply{acct}), $instance, sha256_base64($instance), $token, $session_id, $token, $session_id); + RSSTootalizer::DB->doINSERT("INSERT INTO users (username, username_sha256, instance, instance_sha256, access_token, session_id) VALUES (?, ?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE access_token=?, session_id=?", $$reply{acct}, sha256_base64($$reply{acct}), $instance, sha256_base64($instance), $token, $session_id, $token, $session_id); $self->{"set_cookie"} = ("session_id=".$session_id); } diff --git a/Tweetodon/Website/Dashboard.pm b/RSSTootalizer/Website/Dashboard.pm similarity index 79% rename from Tweetodon/Website/Dashboard.pm rename to RSSTootalizer/Website/Dashboard.pm index 90a6b48..f4fafae 100644 --- a/Tweetodon/Website/Dashboard.pm +++ b/RSSTootalizer/Website/Dashboard.pm @@ -3,13 +3,13 @@ use strict; use HTML::Template; -use Tweetodon::DB; -use Tweetodon::Feed; -use Tweetodon::Website; +use RSSTootalizer::DB; +use RSSTootalizer::Feed; +use RSSTootalizer::Website; -package Tweetodon::Website::Dashboard; +package RSSTootalizer::Website::Dashboard; use Data::Dumper; -@Tweetodon::Website::Dashboard::ISA = qw(Tweetodon::Website); +@RSSTootalizer::Website::Dashboard::ISA = qw(RSSTootalizer::Website); sub requires_authentication { return 1; @@ -25,10 +25,10 @@ sub fill_content { $nf{username} = $main::CURRENTUSER->{data}->{acct}; $nf{instance} = $main::FORM{instance}; $nf{enabled} = "n"; - my $feed = Tweetodon::Feed->create_and_fetch(%nf); + my $feed = RSSTootalizer::Feed->create_and_fetch(%nf); } - my @feeds = Tweetodon::Feed->get_by_user_instance($main::CURRENTUSER->{data}->{acct}, $main::FORM{instance}); + my @feeds = RSSTootalizer::Feed->get_by_user_instance($main::CURRENTUSER->{data}->{acct}, $main::FORM{instance}); my @param_feeds; my $count = 0; FEED: foreach my $feed (@feeds){ diff --git a/Tweetodon/Website/EditFeed.pm b/RSSTootalizer/Website/EditFeed.pm similarity index 89% rename from Tweetodon/Website/EditFeed.pm rename to RSSTootalizer/Website/EditFeed.pm index d404c1e..9d4b965 100644 --- a/Tweetodon/Website/EditFeed.pm +++ b/RSSTootalizer/Website/EditFeed.pm @@ -3,14 +3,14 @@ use strict; use HTML::Template; -use Tweetodon::DB; -use Tweetodon::Feed; -use Tweetodon::Filter; -use Tweetodon::Website; +use RSSTootalizer::DB; +use RSSTootalizer::Feed; +use RSSTootalizer::Filter; +use RSSTootalizer::Website; -package Tweetodon::Website::EditFeed; +package RSSTootalizer::Website::EditFeed; use Data::Dumper; -@Tweetodon::Website::EditFeed::ISA = qw(Tweetodon::Website); +@RSSTootalizer::Website::EditFeed::ISA = qw(RSSTootalizer::Website); sub requires_authentication { return 1; @@ -19,7 +19,7 @@ sub requires_authentication { sub fill_content { my $class = shift; my $output = shift; - my $feed = Tweetodon::Feed->get_by("ID", $main::FORM{id}); + my $feed = RSSTootalizer::Feed->get_by("ID", $main::FORM{id}); unless ($feed){ main::Error("Unknown feed", "This feed id is not known"); return 1; @@ -54,7 +54,7 @@ sub fill_content { $newfilter{regex} = $main::FORM{"regex_new".$id}; $newfilter{type} = $main::FORM{"type_new".$id}; $newfilter{match} = $main::FORM{"match_new".$id}; - my $nf = Tweetodon::Filter->create(%newfilter); + my $nf = RSSTootalizer::Filter->create(%newfilter); } } diff --git a/Tweetodon/Website/JSON.pm b/RSSTootalizer/Website/JSON.pm similarity index 88% rename from Tweetodon/Website/JSON.pm rename to RSSTootalizer/Website/JSON.pm index 1ce2e95..df6f4b6 100644 --- a/Tweetodon/Website/JSON.pm +++ b/RSSTootalizer/Website/JSON.pm @@ -2,13 +2,13 @@ # vim: set foldmarker={,}: use strict; -use Tweetodon::DB; -use Tweetodon::Account; -use Tweetodon::Identity; -use Tweetodon::Website; +use RSSTootalizer::DB; +use RSSTootalizer::Account; +use RSSTootalizer::Identity; +use RSSTootalizer::Website; -package Tweetodon::Website::JSON; -@Tweetodon::Website::JSON::ISA = qw(Website); +package RSSTootalizer::Website::JSON; +@RSSTootalizer::Website::JSON::ISA = qw(Website); use Data::Dumper; use JSON; use MIME::Base64 qw(encode_base64); @@ -61,7 +61,7 @@ sub identity_accounts { $self->{"params"}->{"msg"} = ""; my @accounts; - my $i = Tweetodon::Identity->get_by("id", $main::FORM{"id"}); + my $i = RSSTootalizer::Identity->get_by("id", $main::FORM{"id"}); foreach my $a ($i->accounts()){ my %account; foreach my $k (keys %{$a->{"data"}}){ @@ -84,7 +84,7 @@ sub applications_all { $self->{"params"}->{"msg"} = ""; my @applications; - foreach my $a (Tweetodon::Application->all()){ + foreach my $a (RSSTootalizer::Application->all()){ my %application; foreach my $k (keys %{$a->{"data"}}){ $application{$k} = $a->{"data"}->{$k}; @@ -105,7 +105,7 @@ sub application_by_id { $self->{"params"}->{"status"} = "OK"; $self->{"params"}->{"msg"} = ""; - my $a = Tweetodon::Application->get_by("id", $main::FORM{"id"}); + my $a = RSSTootalizer::Application->get_by("id", $main::FORM{"id"}); foreach my $k (keys %{$a->{"data"}}){ $self->{"params"}->{$k} = $a->{"data"}->{$k}; } @@ -128,9 +128,9 @@ sub application_save { # TODO # my %data; # $data{"login"} = $main::FORM{"login"}; - # $u = Tweetodon::Application->create(%data); + # $u = RSSTootalizer::Application->create(%data); } else { - $a = Tweetodon::Application->get_by("id", $main::FORM{"id"}); + $a = RSSTootalizer::Application->get_by("id", $main::FORM{"id"}); } foreach my $k (keys %{$a->{"data"}}){ @@ -151,7 +151,7 @@ sub application_import_accounts { $self->{"params"}->{"status"} = "OK"; $self->{"params"}->{"msg"} = ""; - my $a = Tweetodon::Application->get_by("id", $main::FORM{"id"}); + my $a = RSSTootalizer::Application->get_by("id", $main::FORM{"id"}); my @accounts; foreach my $acc ($a->get_handler()->import_accounts_from_application()){ my %account; @@ -175,7 +175,7 @@ sub users_all { my @users; my $count = 0; - foreach my $u (Tweetodon::User->all()){ + foreach my $u (RSSTootalizer::User->all()){ my %user; foreach my $k (keys %{$u->{"data"}}){ next if $k eq "password"; @@ -198,7 +198,7 @@ sub user_by_id { $self->{"params"}->{"status"} = "OK"; $self->{"params"}->{"msg"} = ""; - my $u = Tweetodon::User->get_by("id", $main::FORM{"id"}); + my $u = RSSTootalizer::User->get_by("id", $main::FORM{"id"}); foreach my $k (keys %{$u->{"data"}}){ next if $k eq "password"; $self->{"params"}->{$k} = $u->{"data"}->{$k}; @@ -219,9 +219,9 @@ sub user_save { if ($main::FORM{"id"} eq "new"){ my %data; $data{"login"} = $main::FORM{"login"}; - $u = Tweetodon::User->create(%data); + $u = RSSTootalizer::User->create(%data); } else { - $u = Tweetodon::User->get_by("id", $main::FORM{"id"}); + $u = RSSTootalizer::User->get_by("id", $main::FORM{"id"}); } delete $main::FORM{"id"}; foreach my $k (keys %{$u->{"data"}}){ @@ -243,7 +243,7 @@ sub user_identities { $self->{"params"}->{"msg"} = ""; my @identities; - my $u = Tweetodon::User->get_by("id", $main::FORM{"id"}); + my $u = RSSTootalizer::User->get_by("id", $main::FORM{"id"}); foreach my $id ($u->identities()){ my %identity; foreach my $k (keys %{$id->{"data"}}){ @@ -265,7 +265,7 @@ sub identities_save { $self->{"params"}->{"status"} = "OK"; $self->{"params"}->{"msg"} = ""; - my $user = Tweetodon::User->get_by("id", $main::FORM{"id"}); + my $user = RSSTootalizer::User->get_by("id", $main::FORM{"id"}); foreach my $id ($user->identities()){ if (exists($main::FORM{$id->{"data"}->{"id"}})){ $id->{"data"}->{"description"} = $main::FORM{$id->{"data"}->{"id"}}; @@ -276,7 +276,7 @@ sub identities_save { my %data; $data{user_id} = $user->{"data"}->{"id"}; $data{description} = $main::FORM{"new"}; - Tweetodon::Identity->create(%data); + RSSTootalizer::Identity->create(%data); } } diff --git a/Tweetodon/Website/Login.pm b/RSSTootalizer/Website/Login.pm similarity index 68% rename from Tweetodon/Website/Login.pm rename to RSSTootalizer/Website/Login.pm index e66706b..7ba7dd2 100644 --- a/Tweetodon/Website/Login.pm +++ b/RSSTootalizer/Website/Login.pm @@ -2,10 +2,10 @@ use strict; use HTML::Template; -use Tweetodon::Website; +use RSSTootalizer::Website; -package Tweetodon::Website::Login; -@Tweetodon::Website::Login::ISA = qw(Tweetodon::Website); +package RSSTootalizer::Website::Login; +@RSSTootalizer::Website::Login::ISA = qw(RSSTootalizer::Website); sub requires_authentication { return 0; diff --git a/Tweetodon/Website/Logout.pm b/RSSTootalizer/Website/Logout.pm similarity index 70% rename from Tweetodon/Website/Logout.pm rename to RSSTootalizer/Website/Logout.pm index 8f543a7..c73f9b7 100644 --- a/Tweetodon/Website/Logout.pm +++ b/RSSTootalizer/Website/Logout.pm @@ -2,10 +2,10 @@ use strict; use HTML::Template; -use Tweetodon::Website; +use RSSTootalizer::Website; -package Tweetodon::Website::Logout; -@Tweetodon::Website::Logout::ISA = qw(Tweetodon::Website); +package RSSTootalizer::Website::Logout; +@RSSTootalizer::Website::Logout::ISA = qw(RSSTootalizer::Website); sub requires_authentication { return 0; diff --git a/Tweetodon/Website/OAuthLogin.pm b/RSSTootalizer/Website/OAuthLogin.pm similarity index 72% rename from Tweetodon/Website/OAuthLogin.pm rename to RSSTootalizer/Website/OAuthLogin.pm index 0a0b32a..76b2949 100644 --- a/Tweetodon/Website/OAuthLogin.pm +++ b/RSSTootalizer/Website/OAuthLogin.pm @@ -2,13 +2,13 @@ use strict; use HTML::Template; -use Tweetodon::Website; -use Tweetodon::App; -use Tweetodon::Token; -use Tweetodon::User; +use RSSTootalizer::Website; +use RSSTootalizer::App; +use RSSTootalizer::Token; +use RSSTootalizer::User; -package Tweetodon::Website::OAuthLogin; -@Tweetodon::Website::OAuthLogin::ISA = qw(Tweetodon::Website); +package RSSTootalizer::Website::OAuthLogin; +@RSSTootalizer::Website::OAuthLogin::ISA = qw(RSSTootalizer::Website); use Data::Dumper; use JSON; @@ -30,14 +30,14 @@ sub prerender { $self->{"set_cookie"} = ("instance=".$instance); $self->{"params"}->{"currentmode"} = "OAuthLogin"; - my $app = Tweetodon::App->get_or_create_by_instance($instance); + my $app = RSSTootalizer::App->get_or_create_by_instance($instance); $self->{params}->{instance_redirect_uri} = $main::config->{app}->{redirect_uris}; $self->{params}->{instance_client_id} = $app->{data}->{instance_client_id}; $self->{params}->{instance} = $instance; $self->{params}->{token_is_valid} = "false"; if (defined($main::FORM{session_id})){ - my $user = Tweetodon::User->authenticate(); + my $user = RSSTootalizer::User->authenticate(); if ($user){ $self->{params}->{token_is_valid} = "true"; } diff --git a/callback.pl b/callback.pl index c1d51f3..605b863 100755 --- a/callback.pl +++ b/callback.pl @@ -8,11 +8,11 @@ Content-Type: text/html
- + - + diff --git a/static/templates/_navbar.html b/static/templates/_navbar.html index b2f9317..c10070b 100644 --- a/static/templates/_navbar.html +++ b/static/templates/_navbar.html @@ -7,7 +7,7 @@ - Tweetodon + RSSTootalizer