Giter VIP home page Giter VIP logo

libpddokdo's Introduction

libpddokdo (libPDDokdo)

This is a library to get weather which provides by iOS Weather.app easily for jailbroken devices. This library is only for 64-bit deivces. and will be available to download on Packix. PRs are appreciated!

What is Dokdo?

Dokdo is a beautiful island in the east sea of Republic of Korea(South Korea). For more information, visit [https://dokdo.mofa.go.kr/eng/]

Methods

@interface PDDokdo : NSObject
+ (instancetype)sharedInstance;
@property (nonatomic, copy, readonly) NSString *currentTemperature;
@property (nonatomic, copy, readonly) NSString *currentConditions;
@property (nonatomic, copy, readonly) NSString *currentLocation;
@property (nonatomic, strong, readonly) UIImage *currentConditionsImage;
@property(nonatomic, strong, readonly) NSDate *sunrise;
@property(nonatomic, strong, readonly) NSDate *sunset;
@property (nonatomic, strong, readonly) NSDictionary *weatherData;
-(void)refreshWeatherData;
-(NSString *)highestTemperatureIn:(int)type;
-(NSString *)lowestTemperatureIn:(int)type;
@end

What does it provide?

  • Current temperature (ex. 14°)
  • Current Conditions (ex. Mostly Cloudy)
  • Current Location (ex. Gwanak-gu)
  • Current Conditions In Image
  • Today's sunrise time
  • Today's sunset time
  • Today's high temperature (ex. 24°) = Today's low temperature (ex. 10°)

How can I use it on my project?

Here is step by step guide how to use it on your project:

  1. Clone or download this repository on your computer.
  2. run make clean stage. This will install libpddokdo on your computer.
  3. run make do THEOS_DEVICE_IP=(your device ip). This will install libpddokdo on your iOS device.
  4. Now, go to your project and open Makefile and add pddokdo, $(TWEAK_NAME)_LIBRARIES += pddokdo
  5. Open control and add it as a dependency. Depends: com.peterdev.libpddokdo
  6. Open Tweak.x(m) or wherever you want to use this library and add #import <PeterDev/libpddokdo.h> at the top of the source code to import libpddokdo.
  7. Done. Follow below to learn how to get those values from libpddokdo.

How to update libPDDokdo.

  1. Clone or download this repository on your computer.
  2. run make clean stage. This will install libpodokdo on your computer.
  3. run make do THEOS_DEVICE_IP=(your device ip). This will install libpddokdo on your iOS device.
  4. Done. Check if documentation of libPDDokdo has been changed, and update your tweak.

To get multiple values at once.

If you are going to get multiple values at once, USE this method instead of methods below. As you can see the property above, @property (nonatomic, strong, readonly) NSDictionary *weatherData; is a NSDictionary. And you need to refresh weather data.

//Example code
[[PDDokdo sharedInstance] refreshWeatherData];
NSDictionary *weatherData = [[PDDokdo sharedInstance] weatherData];

NSString *temperature = [weatherData objectForKey:@"temperature"];
NSString *condition = [weatherData objectForKey:@"conditions"];
NSString *location = [weatherData objectForKey:@"location"];
UIImage *conditionsImage = [weatherData objectForKey:@"conditionsImage"];
NSDate *sunrise = [weatherData objectForKey:@"sunrise"];
NSDate *sunset = [weatherData objectForKey:@"sunset"];

How to get current temperature.

As you can see the property above, @property (nonatomic, copy, readonly) NSString *currentTemperature; is a NSString. And you need to refresh weather data.

//Example code
[[PDDokdo sharedInstance] refreshWeatherData];
NSString *temperature = [[PDDokdo sharedInstance] currentTemperature];

How to get current conditions.

As you can see the property above, @property (nonatomic, copy, readonly) NSString *currentConditions; is a NSString. And you need to refresh weather data.

//Example code
[[PDDokdo sharedInstance] refreshWeatherData];
NSString *conditions = [[PDDokdo sharedInstance] currentConditions];

How to get current location.

As you can see the property above, @property (nonatomic, copy, readonly) NSString *currentLocation; is a NSString. And you need to refresh weather data.

//Example code
[[PDDokdo sharedInstance] refreshWeatherData];
NSString *location = [[PDDokdo sharedInstance] currentLocation];

How to get current conditions image.

As you can see the property above, @property (nonatomic, strong, readonly) UIImage *currentConditionsImage; is an UIImage. And you need to refresh weather data.

//Example code
[[PDDokdo sharedInstance] refreshWeatherData];
UIImage *conditionsImage = [[PDDokdo sharedInstance] currentConditionsImage];

How to get today's sunrise time.

As you can see the property above, @property(nonatomic, strong, readonly) NSDate *sunrise; is a NSDate. And you need to refresh weather data.

//Example code
[[PDDokdo sharedInstance] refreshWeatherData];
NSDate *sunrise = [[PDDokdo sharedInstance] sunrise];

How to get today's sunset time.

As you can see the property above, @property(nonatomic, strong, readonly) NSDate *sunset; is a NSDate. And you need to refresh weather data.

//Example code
[[PDDokdo sharedInstance] refreshWeatherData];
NSDate *sunset = [[PDDokdo sharedInstance] sunset];

How to get today's high temperature.

As you can see the method above, -(NSString *)highestTemperatureIn:(int)type; returns a NSString. And you need to refresh weather data.

types

  • 0: celsius
  • 1: fahrenheit
  • 2: kelvin
//Example code
[[PDDokdo sharedInstance] refreshWeatherData];
NSString *highTemperature = [[PDDokdo sharedInstance] highestTemperatureIn:0];

How to get today's low temperature.

As you can see the method above, -(NSString *)lowestTemperatureIn:(int)type; returns a NSString. And you need to refresh weather data.

types

  • 0: celsius
  • 1: fahrenheit
  • 2: kelvin
//Example code
[[PDDokdo sharedInstance] refreshWeatherData];
NSString *lowTemperature = [[PDDokdo sharedInstance] lowestTemperatureIn:0];

Special Thanks To

Special thanks to UBIK(@HiMyNameIsUbik) and Appie(@Baw_Appie) for helping me to make this library.

Thanks to Janosch Hübner(@sharedRoutine) and John Zarogiannis(@johnzaro) for PRs.

libpddokdo's People

Contributors

s8ngyu avatar sharedroutine avatar johnzaro avatar

Stargazers

 avatar Do Minh Duy avatar QuanTrieuPCYT avatar Hariz avatar Mira avatar Đinh Vạn Tài avatar haxi0 avatar Zine Eddine avatar  avatar  avatar  avatar lzsxcl avatar LoveZ avatar  avatar Darren Ng avatar dyari avatar Peterpan0927 avatar J.K. Hayslip avatar Brendon avatar  avatar Joshua Seltzer avatar  avatar D.F. avatar Nova avatar Dana Buehre avatar Jeff Rescignano avatar MiRO avatar LacertosusDeus avatar  avatar Thomas avatar BandarHelal avatar  avatar Alex M. avatar Cooper avatar KevinNyaa avatar

Watchers

 avatar  avatar

libpddokdo's Issues

1.3.2 Crashes multiple devices

After upgrading, no issues can be seen immediately. Took me a few hours to encounter issues; Safari kept crashing for me repeatedly. I rebooted the user space and got hung up on the Apple logo, hard reset, tried to rejailbreak, same thing. Had to turn off load tweaks and downgrade the tweak to get everything working again.

Device info probably doesn't matter but I'll provide it anyway: iPhone 12 Pro Max iOS 14.3 unc0ver Fugu jailbreak.

The Reddit post with more affected users can be found here: https://reddit.com/r/jailbreak/comments/v0ssbi/discussion_libpddokdo_causing_issues_when/

weather location incorrect untill refreshing the weather app.

Hi. i found that the library is not fetching the currect location after a respring. it will only take the first city from the weather app.

The location refreshes when the weather app is opened or when the weather widget is displated on the today view.

Can't install it on my computer

Well Im working at a Tweak that needs weather data, so I discovered this library.
I did the steps:

Clone the repo
Run make clean stage
Install on my device
Add to my Tweak Header as <PeterDev/libpddokdo.h>
Add to control, and Makefile depend

But when I build the tweak throws me this error:

fatal error: 'PeterDev/libpddokdo.h' file not found
#import <PeterDev/libpddokdo.h>

Doesn’t work on iPad unless weather widget is added

iPad has no native weather app but for some reason having the weather widget seems to have the same effect as refreshing the data on iPhone. Without the weather widget, tweaks that use this lib just report a null value

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.