import logger import accounts import facebookmodule # LOGGER MODULE logger.Logger( "Events API CRON", "Events API is used to modify AdSets according to events from competitors" ).runtimelog() # ACCOUNTS MODULE data = accounts.Accounts("http://213.162.241.217/fb_bidmod/json_accounts.php", "test").runtimeaccount() # FACEBOOK MODULE print(facebookmodule.FacebookSDKInit().runtimeSDK())
# the Free Software Foundation, either version 3 of the License, or # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. import accounts import os import account_utils ACCOUNT = accounts.Accounts() PERMISSION = account_utils.PolkitPermission("org.freedesktop.accounts.user-administration") #PERMISSION1 = account_utils.PolkitPermission("com.deepin.passwdservice.modify-password") def check_is_myown(uid): ''' check the user id is the current process's user id @param uid: user id, a int type @return: true if the user if current process's user, otherwise false ''' return uid == os.getuid() def get_user_list(account=ACCOUNT): ''' @param account: a accounts.Accounts object @return: a list container some accounts.User objects
# FacebookAdsApi.init(my_app_id, my_app_secret, my_access_token) i = 0 # print data # r = requests.get('http://213.162.241.217/fb_bidmod/json_accounts.php') # data = json.loads(r.text.encode('utf-8')) # logger.Logger("Dynamic Ads API CRON", "Dynamic Ads API is used to create ads according to input").runtimelog() logger.Logger( "Dynamic Ads API CRON", "Dynamic Ads API is used to modify AdSets according to relevant data pulled" ).runtimelog() facebookmodule.FacebookSDKInit().runtimeSDK() data = accounts.Accounts( "https://portal.synlighet.no/fb/accounts/").runtimeaccount() for cu_data in data: act_cid = "act_" + cu_data['cid'] print("Account: ", act_cid) if "season" in cu_data['services']: print("found api") campaign = Campaign(parent_id=act_cid) campaign[Campaign.Field.name] = 'TEST - Product Catalog Sales Campaign' objective = Campaign.Objective.product_catalog_sales campaign[Campaign.Field.objective] = 'LINK_CLICKS' campaign.remote_create(params={ 'status': Campaign.Status.paused,
from geninfo import get_website_info import accounts from socialmedia import create_gmail database = accounts.Accounts() database.display_all() for amount in range(int(input())): person_info = get_website_info() database.add_account(person_info) database.display_all()